Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
IntaBruce
Helper II
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:
IntaBruce_0-1690619856353.png

What have I done wrong?

Thank you

2 REPLIES 2
Greg_Deckler
Super User
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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
TomMartens
Super User
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>)
    , <your expression>
)

 

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.