cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Helper II

## Measure totals don't sum correctly

I have a measure which selects values using two other measures depending on a third measure.

Measures are: Actual Days, Potential days and Latest Actuals Period.  Actual days is only available up to the current period because after that is the future.  So my measure is as follows:

Forecast Days = VAR Period = SELECTEDVALUE(Allocations[Period])
RETURN
IF(Period <= [Latest Actuals Period], [Actual Days], [Potential days])

At first glance this appears to work and returns the correct values but then the totals don't add up and the forecast days only totals the same as the Actual days.  See here:

What have I done wrong?

Thank you

2 REPLIES 2
Super User

@IntaBruce First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Super User

Hey @IntaBruce ,

consider wrapping SUMX around your existing expression like so:

``````measure =
sumx(
values(<the column you are using on the rows of the matrix visual>)
)``````

Hopefully, this helps to tackle your challenge.

Regards,

Tom

Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany