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
Hudg16
Helper I
Helper I

Dividing row by column total

Hudg16_0-1634332242419.png

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? 

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
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:

vkellymsft_0-1634550550437.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
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:

vkellymsft_0-1634550550437.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

AllisonKennedy
Super User
Super User

@Hudg16  

 

Create two new measures:

# Flex Usage Grand Total = CALCULATE ( [# Flex Usage] , ALL() )

 

% of Grand Total Flex Usage = DIVIDE ( [# Flex Usage], [# Flex Usage Grand Total] )


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.