Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Help with TOTAL SUM

Hello, everyone!

 

I have the table below:

MonthIDWeight
January110
January215
January320
February415
February520
February625
March720
March825
March930
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):

MonthIDWeightTOTAL WEIGHT
January11025
January21525
Total 2525

 

I've tried the measures below:

(CALCULATE(Weight, ALL(ID))
(CALCULATE(Weight, ALL(Month))
 
But none of those worked.
 
After that i will divide Weigth / TOTAL WEIGHT to get a percent.
 
I hope i was clear 🙂
Please, somebody help me!
 
 
Thanks 😄
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

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])

 

137.png

 

 

 

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.

View solution in original post

3 REPLIES 3
v-xicai
Community Support
Community Support

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])

 

137.png

 

 

 

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.

amitchandak
Super User
Super User

@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

parry2k
Super User
Super User

@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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.