Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi there,
I am trying to have some calculation as under:
budget | actual | adjusted budget | deviation | absolute deviation |
100 | 70 | 93.8 | -23.8 | 23.8 |
90 | 80 | 84.4 | -4.4 | 4.4 |
50 | 75 | 46.9 | 28.1 | 28.1 |
240 | 225 | 225.0 | 0.0 | 0.0 |
Where Adjusted budget = Budget x ( Total Actual / Total budget)
Deviation = Actual - Adjusted Budget
Absolate Deviation = ABS (Deviation)
But total of absolute deviation comes at 0.0 instead of required 56.3.
Any help?
Thanks all for the reeponse.
I tried creating calculated column as advised by @Anonymous
Here are the resulting matix, upper is based on measures and bottom one is based on calculated columns:
Here are my measures:
Hi @Arshadjehan ,
May be you can give this a try.
In edit queries, hit on Advanced Editor, once the window is open,
change the type of BE and Actual field to type number ( see screenshot below).
Sometimes the decimal point are taken as a rounded value and in that case the values differs.
from this:
to this:
let me know if thsi works.
Thanks,
Tejaswi
Hi @Anonymous
Data in Budget n Actual columns is already in Whole Number format so no chances of rounding off?
There musy be some way / tweak to prevent false zero total for Absolute Deviation Measure, I believe!
Still waiting for the solution......
Hi @Arshadjehan ,
I can't find something useful from your description snapshots. Can you please share a pbix file with some dummy data to test?
In addition, it seems like your formula hs nested multiple measures which will cause the filter conflict on calculation.
Optimizing DAX expressions involving multiple measures
Regards,
Xiaoxin Sheng
Hi @Arshadjehan ,
try this.
Absolate Deviation = SUMX(SUMMARIZE(<table>, <groupBy_columnName>,"@Deviation", [Deviation]), ABS([@Deviation]))
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
HI @Arshadjehan,
It sounds like multiple aggregation calculation issues, you can take a look at the following blog about measure total:
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
I think you are using measures, while performing row calculations. In case of measures, these are evaluated per line and for the Total row (the bottom row), this is evaluated on the dataset with all filters removed. Hence, it is not summing column [Absolute deviation].
In this case, since it is based on row calculations, you could consider calculated columns as that would give you what you want. Could you give us your measure definitions? If you don't want to use Calculated Columns (because you want this to behave correctly in a filtered context), I could have a look in seeing how to make them work in any context (single row table or multi row table context).
Hope this helps, let me know!
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂👍
Proud to be a Super User!
HI @Arshadjehan ,
Use these calculated columns:
User | Count |
---|---|
79 | |
74 | |
44 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |