Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
Could somebody please help me with my dax to get sameperiodlastyear but to match whatever is selected in the slicer?
The slicer is at month/period level. E.G if I select December 2023 I want to see all from December 2022. If I select Oct,Nov,Dec 2023 I want the same calculation for the same 3 months, the year before.
I have the total measure and date calender set up. All of my data is in YYYYMM format but I do have a calender table.
Thanks
Liam
Hi,
Assuming that the month slicer has been built from the Calendar Table and you have already set up a proper relationship, write this measure
Measure = calculate([Sales],sameperiodlastyear(calendar[date]))
Hope this helps.
@lherbert501 You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Also:
@Greg_Deckler I'm using a bridge table to get to the date table. Could this be influencing it?
Thanks. I've tried to match your pbix but SAMEPERIODLASTYEAR just wont have it when I'm only dealing in periods and months it seems
@lherbert501 My main point here is to not use SAMEPERIODLASTYEAR.
User | Count |
---|---|
117 | |
75 | |
62 | |
50 | |
44 |
User | Count |
---|---|
174 | |
125 | |
60 | |
60 | |
57 |