Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello
I need a way to calculate the sum of a measure.
I have two tables (A, B) with the same columns (ID and price) and I need to check if the information in both tables is the same. I have made a report with these characteristics:
- Rows: ID (A)
- Values: price (A), ID (B), price (B), price difference (a measure with the difference between price(A) and price (B)) and difference (a measure that is 0 if the difference is 0 and 1 in another case)
I need to have another measure with the sum of the measurement difference to show it in a target. I've tried using sum, sumx, count,... but they all work with a column, not a measurement.
Could you help me please?
Thank you!
Solved! Go to Solution.
Hi @Anonymous ,
Please try the following measure:
SumScoreMeasure =
SUMX ( ALLSELECTED ( 'Table(A)'[ID(A)] ), [difference] )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try the following measure:
SumScoreMeasure =
SUMX ( ALLSELECTED ( 'Table(A)'[ID(A)] ), [difference] )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149
The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.
Hello @Greg_Deckler ,
Thank you for the information. I have tried to define the measures you comment but something it's wrong, as it returns a 0.
I have defined the measures like this:
MinScoreMeasure = MINX(SUMMARIZE(Table(A),ID(A),"Measure", [difference ] ), [difference ])
MaxScoreMeasure = MAXX(SUMMARIZE(Table(A),ID(A),"Measure", [difference ] ), [difference ])
AvgScoreMeasure = AVERAGEX(SUMMARIZE(Table(A),ID(A),"Measure", [difference ] ), [difference ])
Where difference is a calculated measure that is 0 if the difference between price(A) and price(B) is 0 and 1 in another case.
Thanks!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
87 | |
81 | |
53 | |
37 | |
35 |