Forum Discussion
Market share issue - Distribution over a single year
Hi,
I have tried different measures but I cant see the distribution over a single year.
My formula calculate the market share for all years from 2001 till 2018 but how to do it for only one year ?
one year for one direction (import or export) = 100% market share
Market Share Import = DIVIDE(CALCULATE(SUM([Tons]));CALCULATE(SUM([Tons]);ALL('Details'); Table[Column] = "Import"))
Market Share Export = DIVIDE(CALCULATE(SUM([Tons]));CALCULATE(SUM([Tons]);ALL('Details'); Table[Column] = "Export"))
OR
Market Share = DIVIDE ( CALCULATE ( SUM ( [Tons] ) ), CALCULATE ( SUM ( [Tons] ), VALUES ( Details[Direction] ), ALL ( Details ) ) )
PBIX file = https://drive.google.com/open?id=1sRFKhMPu1LSjMtk58_Z7e_B1BTHhn5FS
Thank you for your help and support,
Jaouad
10 Replies
- v-frfei-msft
Community Support
Hi JaouadZrhibi,
Please update the measure Market Share to this one.
Market Share = DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),ALLEXCEPT('Details',Period[Year])))Also please find the pbix attached.
Regards,
Frank
- JaouadZrhibi
Helper I
Hi Frank v-frfei-msft Hi Greg Greg_Deckler
I thank you for your measure but I need to separate Import & Export markets.
I would like to get 100% market share if we select only IMPORT.
Also 100% market share if we select only EXPORT.
In fact, it isn't pertinent to "mix" import & export markets because they are different markets.
File is here
https://drive.google.com/open?id=1sRFKhMPu1LSjMtk58_Z7e_B1BTHhn5FS
Please see the pictures below. Hope they will help you.
Thank you for your help !
Jaouad
v-frfei-msft wrote:Hi JaouadZrhibi,
Please update the measure Market Share to this one.
Market Share = DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),ALLEXCEPT('Details',Period[Year])))Also please find the pbix attached.
Regards,
Frank
- v-frfei-msft
Community Support
Hi JaouadZrhibi,
Please check the formula again.
Market Share = var maxyear = MAX(Period[Year]) var Direction = SELECTEDVALUE(Details[Direction]) return DIVIDE(CALCULATE(SUM([Tons])),CALCULATE(SUM([Tons]),FILTER(ALL(Details),Details[Year]=maxyear && Details[Direction]=Direction)))
Regards,
Frank