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
Anonymous
Not applicable

How to show the % of subtotals?

Hi,

 

I am trying to show each manufactuer as a % of product type NOT as a % of all/totalproducts.

Example:

Product  Manufactr   Units   %ofProd    %ofTotal

Cars       Mfctr#1       50           67%           45.5%

Cars       Mfct#2        25           33%           22.7%

Cars                          75          100%         68.2%

Trucks    Mfct#1        20           57%           18.2%

Trucks    Mfct#3        15           43%           13.6%

Trucks                      35          100%          31.8%

Total                         110                           100%

 

I know how to find the % of total but how do I calc / show the "% of Product" as shown above? 

 

Thank you for any help in advance!

 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@Anonymous 

 

% of Product =
DIVIDE (
    SUM ( 'Table'[Units] ),
    CALCULATE ( SUM ( 'Table'[Units] ), ALLEXCEPT ( 'Table', 'Table'[Product] ) ),
    0
)

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

In your scenario, you can use @Sean's DAX expression to get percentage of products. Then format the measure to return percentage format values. You can know how use AllExcept() function from this article: Favorite Quick & Easy DAX: Calculate Percent of Total Scenario. Please refer to final results:

 

a2.PNG

 

If you have any question, please feel free to ask.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For me result of that is the same.

https://community.powerbi.com/t5/Desktop/Percent-of-certain-group/td-p/70930?lightbox-message-images...

 

Plus I can´t find divide fuction in desktop.

My  biggist problem is the column  --month , I need 100% for each month , not only for total.

Sean
Community Champion
Community Champion

@Anonymous 

 

% of Product =
DIVIDE (
    SUM ( 'Table'[Units] ),
    CALCULATE ( SUM ( 'Table'[Units] ), ALLEXCEPT ( 'Table', 'Table'[Product] ) ),
    0
)

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.