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
kthakur
Helper I
Helper I

Market Share calculation in Dax

Hi Experts,

 

I need your help in calculating Market share for one of my complex senario.

 

I want to calcualte market share and display the top 5 products across the country. Client has certain requiremnet here.

Remove the certain products and sub products from certain market. For example I have Market1,Market2...Maerket10.

 

Market 1 has 10 products and 10 products have 30 subproducts in total. Same for other markets as well. 

Client wants to exclude the two product from market 1,

2 sub products from market2->product5

Same for other market.

 

I need DAX calcualtion for calcuationg the Market share excluding the above example

Please help me to build the metrics.

 

Thanks

Krishna

 

8 REPLIES 8
Anonymous
Not applicable

Something like:

 

MS % = DIVIDE(   CALCULATE(SUM([UNITS]);'DimProduct'[COD] = XXXX || 'DimProduct'[COD] = YYYY);
                    CALCULATE(SUM([UNITS]);'DimProducts'[COD] = ZZZZ))

etc etc

Thanks Svalen, I will try this but not sure how it will work in my scenario.

 

I am explaning my scenario again, I have to calculate in same metrics and conditions are like this

1. i have three hierarchy Market->Product-> sub product

2. 1st scenario, take only few sub products from one product

3. 2nd senario, exclude all sub proudct except one from calculation

 

Please advise.

Anonymous
Not applicable

MS % = DIVIDE(   CALCULATE(SUM([UNITS]);'DimProduct'[SUBPRODUCT] = "XXXX" || 'DimProduct'[SUBPRODUCT] = "YYYY");
                    CALCULATE(SUM([UNITS]);'DimProduct'[PRODUCT] = "ZZZZ") && 'DimProduct'[MARKET] = "AAAA")

You have to select the market, product and subproduct manually on your measure, like above.

If i select values from prompt i am getting the data now also but this report is for top management and they dont want any prompt.

 

They need top 5 products as per market share(country can be prompt) but conditioned applied for market share calculation.

 

currently client is doing this calculation manually in Excel.

 

Thanks

krishna

 

tex628
Community Champion
Community Champion

How does your dataset look like? Does it have this structure?

 

image.png


Connect on LinkedIn

Yes, my data structre is kind of same, Month is inclded in that(i am calculating market share for year).

 

client doesnt want to select product and subproduct from prompt.

 

Thanks

Krishna

tex628
Community Champion
Community Champion

Now i only have two products in my small table so it doesnt really look right, But doesnt this simply work? 


Format the spend/value to % of GTFormat the spend/value to % of GTAdvanced filter on the specific items that you want removedAdvanced filter on the specific items that you want removed
Filter away specific products / subproducts in the field to the right. 


Connect on LinkedIn
Anonymous
Not applicable

What do you want to use for selection? A slicer? That way, to calculate sold units, you could do something like:

 

CALCULATE(SUM([UNITS]);'Table'[SUBPRODUCT] IN ALLSELECTED('Table1'[SUBPRODUCT]))

and then you can build your calculations for market share as you want.

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.