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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Touaibia
Frequent Visitor

Market Share delta calculation

Hello everyone,

 

I'm new in PowerBi and i want to calculate the "market share Delta" for my Dashboard. (Market share gain or loss YOY).

 

Soo i first started  calculating the current year MS with this mesure : 

Market Share =
DIVIDE([total_value],(CALCULATE(SUM('Sell-out Gers'[Value]),ALL('Sell-out Gers'[Level 2])
)))
And in the second step i'm supposed to calculate the Market Share for the last Year or the N-1 and i'm stuck anyone can give  me a tip on how i should write my code ? i tried "dateadd" and "sameperiodelastyear" functions but obviosly i'm doing somthing wrong.
 
Thanks By advance.
 
BR,
3 REPLIES 3
daxer-almighty
Solution Sage
Solution Sage

Please read this: Standard time-related calculations – DAX Patterns

To do such calculations your model needs to be a proper star-schema and have a proper Date(time) dimension.

Please read this: Understand star schema and the importance for Power BI - Power BI | Microsoft Docs

Hello and Thanks for your aswer, actually i'm receiving this data from a 3rd part vendor soo the data model is perfectly set and my time dimension is clean.

I also calculated my last year sales with this formula : 

 

LY_Sales = CALCULATE([total_value],SAMEPERIODLASTYEAR('Sell-out Gers'[Date].[Date]))
 
And it works. But for market share delta i'm still stuck 😞
 
BR,
 
 
 

 

Sorry to say that but this line:

LY_Sales = CALCULATE([total_value],SAMEPERIODLASTYEAR('Sell-out Gers'[Date].[Date]))

is a clear sign your model is WRONG. Simply wrong.

 

But I don't have time to explain why. There are too many articles (even on this forum) that explain why. I don't have time to repeat.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.