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

Sum by two groups

Hi experts,

 

Would you please help me sum the total by both type and class

 

End result should be 

 

HS--> 1000

TM --> 1520

 

 

 

ClassTypeTotal
AHS500
AHS500
ZHS500
ZHS500
ZHS500
ZHS500
CTM760
LTM760
...
...
...
...
1 ACCEPTED SOLUTION

@Anonymous So tweak your measure like below:

Measure = CALCULATE(SUM('Table'[Total]),ALLEXCEPT('Table','Table'[Class]))
Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

6 REPLIES 6
v-xiaoyan-msft
Community Support
Community Support

Hi @Anonymous ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

@Anonymous Create a measure like below:

Measure = CALCULATE(SUM('Table'[Total]),ALLEXCEPT('Table','Table'[Type]))
Capture.JPG
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

This won't work as it will return 3000 for HS as it is not considering the Class in the equation.

 

HS should be 1000

@Anonymous So tweak your measure like below:

Measure = CALCULATE(SUM('Table'[Total]),ALLEXCEPT('Table','Table'[Class]))
Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
selimovd
Super User
Super User

Hey @Anonymous ,

 

you can just create a matrix and put the Type in the rows and the total in the values. Then it will sum by Type.

Otherwise you could create measures:

Sum HS =
CALCULATE(
    SUM( myTable[Total] ),
    myTable[Type] = "HS"
)

 

and for TM:

Sum TM =
CALCULATE(
    SUM( myTable[Total] ),
    myTable[Type] = "TM"
)

 

The measures set the filter of the type to HS or TM and for that reason you will always get the sum for the corresponding type.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

This won't work as it will return 3000 for HS as it is not considering the Class in the equation.

 

HS should be 1000

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.