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'm having problems to create the sum of the division on lower level.
I have 2 calculations, on 2 different tables, linked to a general code (1 with a many tot many table in between)
On the lowest the results are fine, I try to calculate the value in red (this is the sum, of the rows in orange square)
Calculation should keep on working when filtering out products, or Groupcodes.
Following datamodel:
power bi file: https://wimv.be/forumpost/Subtotal_of_calculation.zip
calculation of inventory Qty:
Inventory Qty = SUM([SalesQty])
calculation of Treshold Qty Rs:
Treshold Qty RS = if(HASONEVALUE(GeneralCode[GeneralCode]);
CALCULATE([Treshold Qty];FILTER(GeneralCode;[GeneralCode]<>[GeneralGroupCode]));
blank()
)
calculation of Treshold Evaluation TMP:
Treshold Evalulation TMP =
if(HASONEVALUE(SevesoCode[SevesoGroupCode])
;DIVIDE([Inventory Qty];[Treshold Qty RS])
;blank() // sum formula needed or in a seperate formula
)
Best Regards,
Wim
Solved! Go to Solution.
You may try the measure below.
Measure =
SUMX (
VALUES ( GeneralCode[GeneralCode] ),
DIVIDE (
[Inventory Qty],
[Treshold Qty RS]
)
)
You are going to need to SUMMARIZE or GROUPBY and use the X functions across it. 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
Thx for Replying @Greg_Deckler
I understand that I need to create a summarize table, and have a sumx on top.
The problem is creating the summarized table in this specific setup with a many 2 many relation,
when trying to create the summarized table, it's not giving values on row level.
update file with summarized table: Subtotal_of_calculation_zipfile
You may try the measure below.
Measure =
SUMX (
VALUES ( GeneralCode[GeneralCode] ),
DIVIDE (
[Inventory Qty],
[Treshold Qty RS]
)
)
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 | |
100 | |
86 | |
64 |