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
Hi,
I'm trying to create a report to slice my measure through multiple calculation groups :
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.
Regards
@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.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 40 | |
| 34 | |
| 25 |