The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a table like the one below, where I have created the column Dif and DIf*Vol. However, when I try to see the total of the column Dif*Vol, it doesnt show the grand total. Instead, he does the same calculation as the other lines. All I want is to have a big number showing the real difference.
Important to note: The B column is a calculated measure and therefore is dynamic. Therefore, I cant edit the data source and do it directly in the database.
Source | A | B (Calc Measure) | Volume | Dif (A-B) | Dif *Vol |
Z | 1100 | 1070 | 30 | 30 | 900 |
Y | 1100 | 1080 | 30 | 20 | 600 |
M | 1100 | 1090 | 30 | 10 | 300 |
N | 1100 | 1090 | 30 | 10 | 300 |
J | 1100 | 1000 | 30 | 100 | 3000 |
5500 | 5330 | 150 | 170 | 25500 |
The red number should be 5100 - the sum of the lines above.
The ideal scenario was to calculate this column directly in the database instead of creating a calculated measure. However, the B column is dynamic and can be changed based on a parameter table.
How can I do that?
Thank you.
Solved! Go to Solution.
Hello @Mareias
You should use SUMX to iterate over Source and sum the values of Dif*Vol.
Try creating a measure that looks something like this:
= SUMX ( VALUES ( YourTable[Source] ), [Dif*Vol] )
I'm assuming [Dif*Vol] is a measure. You could also replace [Dif*Vol] with the components of the calculation as long as they are measures (or wrapped in CALCULATE).
Regards,
Owen
Hello @Mareias
You should use SUMX to iterate over Source and sum the values of Dif*Vol.
Try creating a measure that looks something like this:
= SUMX ( VALUES ( YourTable[Source] ), [Dif*Vol] )
I'm assuming [Dif*Vol] is a measure. You could also replace [Dif*Vol] with the components of the calculation as long as they are measures (or wrapped in CALCULATE).
Regards,
Owen