
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do I create a sum based on a condition?
Hi
I'm really hoping someone can help me. I am trying to create a sum which adds up all of the [Actual cost] and the [Estimated cost] ( if the [Actual cost] has a figure in it) for last month.
This is what I have come up with but it doesn't seem to be working and I don't know where I am going wrong.
Expression
(Sum({<[Date]={">=01/12/2022<=31/12/2022"}>}[Actual Value]))
+
(Sum({<[Actual Value]=NULL,[Date]={">=01/12/2022<=31/12/2022"}>}[Estimated Value]))
Current results
As you can see when I try and create the total value sum it pulls through the [Actual Value] but not the [Estimated Value] if [Actual Value] is blank.
As always, any help would be gratefully received.
Many thanks
Louise

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe like this?
(Sum({<[Date]={">=01/12/2022<=31/12/2022"}>}[Actual Value]))
+
(Sum({<[Actual Value]={">0"},[Date]={">=01/12/2022<=31/12/2022"}>}[Estimated Value]))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hiya
Thanks for taking the time to try and help. Unfortunately that doesn't work as this is now adding the 2 fields together where both have information and not including estimate where actual is 0.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
slight tweak.
(Sum({<[Actual Value]={">0"},[Date]={">=01/12/2022<=31/12/2022"}>}[Actual Value]))
+
(Sum({<[Actual Value]={"=0"},[Date]={">=01/12/2022<=31/12/2022"}>}[Estimated Value]))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
(Sum({<[Date]={">=01/12/2022<=31/12/2022"}>}[Actual Value]))
+
(Sum({<[Date]={">=01/12/2022<=31/12/2022"}>}[Estimated Value]))
remove the Null condition and check
