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.
Hi,
I have a measure which calculates cost based on parameters. At the row level, the cost is correct. But the totals show incorrect results.
The expected results are:
Drinks - 13
Fruit - 5
TOTAL - 18
Can someone help correct my calculation please?
Solved! Go to Solution.
Please try this expression that references your existing Cost measure. Replace Table with your actual table name.
Cost SUMX = SUMX(VALUES(Table[Category]), [Cost])
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi, @mr_reygan
According to your description, you want to get the correct total in the total row, you can try my steps:
Cost_new =
var _new=SUMMARIZE('Table','Table'[Category],"_value",[Cost])
return IF(HASONEVALUE('Table'[Category]),[Cost],SUMX(_new,[_value]))
And you can get what you want.
You can create a new measure for every measure which has a wrong total value in Matrix using this method and replace them in the chart.
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@mr_reygan , Try like
sumx(Summarize(Table, Table[category], "_1",[Cost]),[_1])
@amitchandak , great! it worked! 🙂
Do I always have to create 2 measures? 1 for row level and another 1 for totals?
Please try this expression that references your existing Cost measure. Replace Table with your actual table name.
Cost SUMX = SUMX(VALUES(Table[Category]), [Cost])
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |