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
bhaskarasalla
Frequent Visitor

Want to show percentage for specific product

Hi All,

I need one help for solving a below issue-

I have tried by using calculate & calculate all function but still now able to solve-

Here is problem

This is my data

 Category      Product  Value

Category1Apple10
Category1grapes20
Category1oranges30
Category1banana40
Category2Apple20
Category2grapes60
Category2oranges30
Category2banana40

  I want to create a chart ( table) to show category, product and value, and percenate (for that particular product )

Product Category1ProductValueValue_Sum_AllProductsProduct%
Category1Apple104025
Category1oranges304075
Category2Apple205040
Category2oranges305060

 

Here i considered only two product Apple & Oranges and excluded other product from visual level filter.

i created this measure 

Value_Sum_AllProducts = CALCULATE(SUM(Sheet1[Value]),ALL(Sheet1[Product])) 
but its consider all products but in my case i want to show Apple and Oranges sum for each category
 
Appreciate your efforts 🙂
1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi @bhaskarasalla,

here is one way of achieving it

AllProductsPrCategory =
CALCULATE (
    SUM ( 'Table'[Value] );
    FILTER ( ALL ( 'Table'[Product] ); 'Table'[Product] IN { "Apple"; "oranges" } )
)

cheers,
S

View solution in original post

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @bhaskarasalla,

here is one way of achieving it

AllProductsPrCategory =
CALCULATE (
    SUM ( 'Table'[Value] );
    FILTER ( ALL ( 'Table'[Product] ); 'Table'[Product] IN { "Apple"; "oranges" } )
)

cheers,
S

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.

Top Solution Authors