Forum Discussion
kalpesh07
2 years agoFrequent Visitor
DAX
Hi All, I need help with DAX Formula to calculate Market Share. I've Master Data which is very clean but is a combination of Value & Volume by Segment,Manufacturer, Brand at MONTH Level. - Basic...
- Anonymous2 years ago
HI kalpesh07,
Perhaps you can try to use the following measure formula if it suitable for your requirement:
formula = DIVIDE ( SUM ( MarketData[Sales Value] ), CALCULATE ( SUM ( MarketData[Sales Value] ), ALLSELECTED ( MarketData ), VALUES ( MarketData[SEGMENT] ), VALUES ( 'Calendar'[Date] ) ), 0 )Regards,
Xiaoxin Sheng
rajendraongole1
2 years agoSuper User
Hi kalpesh07 - Can you try below calculation, adding with segment and dateperiod . Hope you already have the date table in your model.
Market Share =
DIVIDE(
SUM(MarketData[Sales]),
CALCULATE(
SUM(MarketData[Sales]),
FILTER(
ALLSELECTED(MarketData),
MarketData[SEGMENT] = MAX(MarketData[SEGMENT]) &&
'DateTable'[DatePeriod] = MAX('DateTable'[DatePeriod])
)
),
0
)
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!