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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
WSeirafi
Helper I
Helper I

Slicing with multiple calculation groups

Hi,

 

I'm trying to create a report to slice my measure through multiple calculation groups :

  • Units
  • Date Period
  • Type of metric

And my issue is that I'm trying to calculate a market share for the past year but the sameperiodlastyear function is not working for me, and when I check the first date in my table, it seems like my date filter context is ignored withing my matrix.

 

Sorry I cannot share with you my data model.

 

Thanks in advance for you time.

 

RegardsCapture.PNGCapture.PNG

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@WSeirafi , can you please share the formula used?  Make sure you are using Date table

 

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I just fixed it by myself and it seems working, but in a nutshell I had to use SAMEPERIODLASTYEAR in the intermediate calculations, using it in the final line was not working for a reason I ignore

Of course.

 

Here is my market share formula 

 

VAR AllVolume = CALCULATE ( [Selected Sales Unit], ALL ( 'Source Product'[Source Manufacturer], 'Source Product'[Source Brand Name], 'Source Product'[Source Pack Name] ) ) RETURN DIVIDE ( [Selected Sales Unit], AllVolume, 0 )

 And my past year formula 

VAR AllVolume = CALCULATE ( [Selected Sales Unit], ALL ( 'Source Product'[Source Manufacturer], 'Source Product'[Source Brand Name], 'Source Product'[Source Pack Name] ) ) VAR CY = DIVIDE ( [Selected Sales Unit], AllVolume, 0 ) RETURN CALCULATE ( CY, SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

I have one global market share measure with the same formula as well, that is not in the calculation group, but not working too.

 

And yes I'm using a date table of course.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.