Forum Discussion

justinMcC's avatar
justinMcC
Frequent Visitor
8 years ago
Solved

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.

 

 

 

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

 

 

 

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

     

1 Reply

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