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
HKSpring
Regular Visitor

Percent Contribution of Products in a Group

I will have Item Levels as below.  Every Item has sales entries with QTY & Amount.

 

I may use PAGE FILTERS / SLICERS to First Filter

  • I wish to choose which Category First & then if need to filter down into Product Group --> will select Product Group
    • and then select 1/more than 1 product from that selected Product Group
      • then Selected List of Products (to be filtered) in their particular PRODUCT GROUP (or) from Category

I want to know Matrix / Chart / PIE showing PERCENT Contribution of 

  • selected Single Product % in a Product Group
    • e.g., APPLE SALES CONTRIBUTION % in Fruits Group (OR)
  • Group of Selected Products % contribution in selected Product Group/Groups
    • SONY + LG + SAMSUNG COMBINED SALES Contribution % in TV sales

 

CATEGORYPRODUCT GROUPITEMS
AFRUITSAPPLE
  ORANGE
  MELON
 VEGETABLESCABBABGE
  LEMON
  TOMATO
  CARROT
 PP3 
BTVSONY
  LG
  SAMSUNG
  TOSHIBA
  TLC
  PHILIPS
 PPB2 
 PPB3 
 PPB5 

 

Thanks in Advance for your advices.

1 ACCEPTED SOLUTION

Hi @HKSpring ,

 

Please try the measure.

 

Measure = 
VAR PG_Total =
    CALCULATE (
        SUM ( 'Table'[SALES] ),
        ALL ( 'Table'[ITEMS] )
    )
RETURN
    DIVIDE ( SUM ( 'Table'[SALES] ), PG_Total )

vkkfmsft_0-1659509139000.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @HKSpring ,

 

Please try the measure.

 

Contribution % = 
VAR Total =
    CALCULATE ( SUM ( 'Table'[SALES] ), ALLSELECTED () )
VAR PG_Total =
    CALCULATE (
        SUM ( 'Table'[SALES] ),
        ALLSELECTED (),
        VALUES ( 'Table'[CATEGORY] )
    )
VAR Items_Total =
    CALCULATE (
        SUM ( 'Table'[SALES] ),
        ALLSELECTED (),
        VALUES ( 'Table'[PRODUCT GROUP] )
    )
RETURN
    SWITCH (
        TRUE (),
        ISFILTERED ( 'Table'[ITEMS] ), DIVIDE ( SUM ( 'Table'[SALES] ), Items_Total ),
        ISFILTERED ( 'Table'[PRODUCT GROUP] ), DIVIDE ( SUM ( 'Table'[SALES] ), PG_Total ),
        DIVIDE ( SUM ( 'Table'[SALES] ), Total )
    )

vkkfmsft_0-1658985828295.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear v-kkf-msft,

 

Thanks for your suggestion.

 

I have below problem with above measure.  

HKSpring_0-1659282472128.png

As you can see on above photo, if I select Product Group first ---> no more selection on Products, contribution% is correct.

-------------------------------------------------------------------------------

HKSpring_1-1659282539275.png

 

If I FILTER 1 Product Group ---> Then FILTER 1(or)more products from the Items 

Results are wrong.

 

What I require is After Selecting Product Group, I like to selelct few products from the list (multi select) and compare the contributions of 10 products from that prouduct group (out of 1000s products in that product gorup).  And want the contribution percentage to be not changed (if date range filter is not changed).

Thanks a lot in advance.

Hi @HKSpring ,

 

Please try the measure.

 

Measure = 
VAR PG_Total =
    CALCULATE (
        SUM ( 'Table'[SALES] ),
        ALL ( 'Table'[ITEMS] )
    )
RETURN
    DIVIDE ( SUM ( 'Table'[SALES] ), PG_Total )

vkkfmsft_0-1659509139000.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.