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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JeroenZuidlaren
Frequent Visitor

Total for DAX measure does not work [SUMMARIZE function]

Hello,

 

I have created a measure "UrenKosten_Test3"

The measure should summarize the total cost per "Code" based on:
- number of hours for a Code > this is capured in a measure "WBSOGeschrevenTMMaand"
- Uurtarief, ForfaitI, ForfaitII, these are in a budget Table and used as a variable in this measure.

In the visual table the calculation on Code level is correct.

However the total is incorrect. It seems it is calculated based on the Minimum of all Uurtarief [21] and all Forfaits [10].

(21+10=31) x 4.253 = 131.843

 

However the total should be the sum of the individual codes:

30.021 + 19.096 + 49.256 + 30.888 = 129.261

I thought this is exactly what is summarize in the _table and with a SUMX this should be the total result.


What do I miss?

 

JeroenZuidlaren_0-1713183258202.png

 

1 ACCEPTED SOLUTION

Hello @Greg_Deckler . I have solved this issue.

The T1 and T2 need to be part of the IF statement. Only then it is summarizing correctly per Code.


I have another issue with this dataset but will prepare sample data tomorrow and mention that over here or start a new post. Thanks!

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@JeroenZuidlaren 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


@ 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...

Thanks a lot @Greg_Deckler ! I have voted for the idea.

 

I also studied the links but it seems it is not the "classic" issue.

 

The point in my DAX statement is that for the total row the statement is looking to var T1 & T2 as the minimum values of everything in the budget table.
However it should calculate in the IF statement with the minimum values per code. 

 

In the table it is doing this because the Code is in the Row context.

For the total there is no context.


I was expecting because I build the _table that it was picking per code the minumum values T1 & T2 and calculates the outcomes with that. Then I just need to SumX the total.

However this does not work...

 

thanks again.
Jeroen

@JeroenZuidlaren Going to need sample data. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ 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...

Hello @Greg_Deckler . I have solved this issue.

The T1 and T2 need to be part of the IF statement. Only then it is summarizing correctly per Code.


I have another issue with this dataset but will prepare sample data tomorrow and mention that over here or start a new post. Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.