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
justinMcC
Frequent Visitor

DAX to get group total

Hi,

 

I am using a matrix table to represent product sales by category. I am using measures to calculate treatment courses an treatment days.

 

 

purchases.JPG

 

My issue is that the Sub Totals for group don't show the sum of the above rows but actually applies the calculations in measures to determine sub total.

 

The meausres I have created to get column4 figures are as follows:

 

 measure = SUM(transactions[sales] / ([measure2] / MIN(clinical_number)) 

 

In this instance measure2 = 200

 

Thanks for your help

 

 

 

1 ACCEPTED SOLUTION
muchinski
Resolver II
Resolver II

Can you explain better your example?

I can't identify transactions[sales] or MIN(clinical_number) or even know the calculation you use for [measure2].

 

In any case, just to save some time here. If Miscellaneous is you [category] and the drill is [product], the for you to have the value of the parent group, you can use the ALLSELECTED function. See the sample bellow:

 

Total for Category = 
CALCULATE([measure2], ALLSELECTED('MyTable'[product]))

 

View solution in original post

1 REPLY 1
muchinski
Resolver II
Resolver II

Can you explain better your example?

I can't identify transactions[sales] or MIN(clinical_number) or even know the calculation you use for [measure2].

 

In any case, just to save some time here. If Miscellaneous is you [category] and the drill is [product], the for you to have the value of the parent group, you can use the ALLSELECTED function. See the sample bellow:

 

Total for Category = 
CALCULATE([measure2], ALLSELECTED('MyTable'[product]))

 

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.