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.
Hello, everyone!
I have the table below:
Month | ID | Weight |
January | 1 | 10 |
January | 2 | 15 |
January | 3 | 20 |
February | 4 | 15 |
February | 5 | 20 |
February | 6 | 25 |
March | 7 | 20 |
March | 8 | 25 |
March | 9 | 30 |
TOTAL | 180 |
I need to create a measure to get the TOTAL WEIGHT and it stills get the correctly result, even i filter the table.
For exemple, if i filter by month = January and ID = 1 and 2, i want a measure that can get the total sum.
Something like this (column TOTAL WEIGHT is the expected result that i need):
Month | ID | Weight | TOTAL WEIGHT |
January | 1 | 10 | 25 |
January | 2 | 15 | 25 |
Total | 25 | 25 |
I've tried the measures below:
Solved! Go to Solution.
Hi @Anonymous ,
You may create measure like DAX below.
TOTAL WEIGHT = CALCULATE(SUM(Table1[Weight]),ALLSELECTED(Table1))
Percent = DIVIDE(SUM(Table1[Weight]), CALCULATE(SUM(Table1[Weight]) , ALLSELECTED(Table1)))
or use the measure:
Percent = DIVIDE(SUM(Table1[Weight]), [TOTAL WEIGHT])
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You may create measure like DAX below.
TOTAL WEIGHT = CALCULATE(SUM(Table1[Weight]),ALLSELECTED(Table1))
Percent = DIVIDE(SUM(Table1[Weight]), CALCULATE(SUM(Table1[Weight]) , ALLSELECTED(Table1)))
or use the measure:
Percent = DIVIDE(SUM(Table1[Weight]), [TOTAL WEIGHT])
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
For weight
CALCULATE(Weight)
for sub total
CALCULATE(Weight, ALLselected(Table))
CALCULATE(Weight, allexpect(Table,Table[Month]))
Also, how can you use removefilters
https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak
@Anonymous add a measure like this
Total Weight = CALCULATE ( SUM ( Table[Weight] ), ALL ( Table ) )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |