Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

category contribution with mutliple categories in the list of items.

Dear community,
Can you please assist me in writing a dax formula similar to sumif, also, show the result in the same matrix where a total contribution is viewed. 
please view my attachment to get a better idea. 

what I need to show is (if a product from the spice category is in scope then sales of that product divided by sales from total spice category in current filter context))

Hazari_1-1601559185021.png

Thank you so much in advance. 

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try this:

 

Calculated column:

Column = 
var cat = CALCULATE(SUM('Table'[sales]),ALLEXCEPT('Table','Table'[cat]))
return
DIVIDE('Table'[sales],cat)

Measure:

Measure = 
var cat = CALCULATE(SUM('Table'[sales]),ALLEXCEPT('Table','Table'[cat]))
return
DIVIDE(SUM('Table'[sales]),cat)

v-xuding-msft_0-1601963000620.png

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Dear 

 
 
 
 
 
 
 
 
 

 

amitchandak
Super User
Super User

@Anonymous , Think this requires a dynamic segmentation.

Refer to this file attached after signature and video on a similar topic. The file also have a cumulative  bucket video does not explain that.

https://youtu.be/CuczXPj0N-k

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.