March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I have below 4 tables, what I need is to calculate the amount of column name NEED.
I try CALCULATE, FILTER, ALL, ALLEXCEPT can't get the result I want.
Can anyone give me a suggestion? thank you so much.
TABLE1 | TABLE2 | TABLE3 | DataTable | ||||||||
L1 | L1 | L2 | L2 | L3 | L3 | AMT | NEED | NEED | |||
A | A | AA | AA | AA1 | AA1 | 75 | 100 | 75% | |||
E | E | EE | AA | AA2 | AA2 | 25 | 100 | 25% | |||
P | E | EEE | EE | EE1 | EE1 | 100 | 100 | 100% | |||
P | PP | EEE | EEE1 | EEE1 | 10 | 100 | 10% | ||||
P | PPP | EEE | EEE2 | EEE2 | 20 | 100 | 20% | ||||
P | PPPP | EEE | EEE3 | EEE3 | 70 | 100 | 70% | ||||
PP | PP1 | PP1 | 50 | 50 | 100% | ||||||
PPP | PPP1 | PPP1 | 80 | 80 | 100% | ||||||
PPPP | PPPP1 | PPPP1 | 100 | 500 | 20% | ||||||
PPPP | PPPP2 | PPPP2 | 300 | 500 | 60% | ||||||
PPPP | PPPP3 | PPPP3 | 100 | 500 | 20% |
Solved! Go to Solution.
Hi @studyri10 ,
My data model is as below.
Please try code as below to create calculated columns.
Need Sum =
CALCULATE(SUM('DataTable'[AMT]),ALLEXCEPT('DataTable', TABLE2[L2],TABLE1[L1]))
Need Percentage =
DIVIDE('DataTable'[AMT],'DataTable'[Need Sum])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @studyri10 ,
My data model is as below.
Please try code as below to create calculated columns.
Need Sum =
CALCULATE(SUM('DataTable'[AMT]),ALLEXCEPT('DataTable', TABLE2[L2],TABLE1[L1]))
Need Percentage =
DIVIDE('DataTable'[AMT],'DataTable'[Need Sum])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@studyri10 What is the result that you want?
First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
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
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
206 | |
150 | |
97 | |
78 | |
69 |