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
Rup10
Resolver I
Resolver I

Percentage of Grand total in a table

Hi,

I have a table in PowerBI desktop and i have total 5 columns as below : 

 

RegionMonthINVCost%Total
AFR1477400098%
APC26763200097%
Grand Total 115336000 

 

I have added a custom column (total):

Custom Column Formula : Divide(INV/Cost)

So here, I can get the Grant total of INV and Cost but am not able to get the Grand total percentage( Percentage should be like 100%only)

Grant Total formula : INV/Cost

Can you please someone help me with this.

Thanks in advance

1 ACCEPTED SOLUTION

That's simple math for DAX, but it's not really a "% of Total" is it?

 

The DAX Measure you want is exactly as you describe:

My Measure = DIVIDE ( SUM ( [Cost] ) , SUM ( [INV] ), 0 )

 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
Rup10
Resolver I
Resolver I

Actually my requirement is :

%total = Grand total of Cost(6000)/Grand total of INV(1000)*100

These details should be reflected to total label under %total.Below is the table for your reference.

RegionMonthINVCost%total
AFR345025002500/450(cost/inv)
ASA455035003500/550(cost/inv)
Grand Total 100060006000/1000(Grand total cost/grand total inv)

 

Thanks

 

That's simple math for DAX, but it's not really a "% of Total" is it?

 

The DAX Measure you want is exactly as you describe:

My Measure = DIVIDE ( SUM ( [Cost] ) , SUM ( [INV] ), 0 )

 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





v-alq-msft
Community Support
Community Support

Hi, @Rup10 

 

Based on description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

f1.png

 

You may create a custom column with the following m codes.

[INV]/[Cost]

 

f2.png

 

Then you need to set the aggregation of 'Custom' as 'Sum'

 f3.png

 

Best Regards

Allan

 

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

ToddChitt
Super User
Super User

Not sure I understand the math here. For the first row, 477 divided by 4000 is NOT 98%.

 

You should make your calculation be a MEASURE instead of a COLUMN. A Measure can operate on the whole table.

 

My Measure = DIVIDE ( SUM(INV), SUM(Cost), 0)




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





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.