Forum Discussion
Dividing row by column total
I have the column "# Flex Usage" measure and want to get a % of the total for these. For example, in the last row, I want to see 9/130. How can I do this?
Hi Hudg16 ,
Create a measure as below:
Measure = var _total=CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Name]=MAX('Table'[Name]))) Return DIVIDE(SUM('Table'[Value]),_total)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
3 Replies
- AllisonKennedy
Community Champion
Create two new measures:
# Flex Usage Grand Total = CALCULATE ( [# Flex Usage] , ALL() )
% of Grand Total Flex Usage = DIVIDE ( [# Flex Usage], [# Flex Usage Grand Total] )
- AllisonKennedy
Community Champion
Hudg16 Please let us know if your problem has been solved. v-kelly-msft has provided an alternate solution if you want to divide by the subtotal instead of my solution which uses Grand Total.
Of course, any questions you have on why or how they work, just ask!
- v-kelly-msft
Community Support
Hi Hudg16 ,
Create a measure as below:
Measure = var _total=CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Name]=MAX('Table'[Name]))) Return DIVIDE(SUM('Table'[Value]),_total)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!