The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi All,
I'm trying to do a YoY Comparison for 2021 and 2020, so when I use the sameperiodlastyear it compares the exact same date last year but I want it to calculate one day ahead
For Ex: My date range is 19 Dec 2021 to 25 Dec 2021, it should compare 20 Dec 2020 to 26 Dec 2020
Kindly help!
Solved! Go to Solution.
@Naveeduddin , Try a measure like
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))
Hi,
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
If I may suggest other than the below, if you have calendar table with week number column, you can compare it by utilizing the same week number last year.
Thank you! This was helpful
Wow, Amazing! This worked. Thanks a lot
Hi,
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
If I may suggest other than the below, if you have calendar table with week number column, you can compare it by utilizing the same week number last year.
Not by a computer however SAMEPERIODLASTYEAR returns a table of dates. I think you should just be able to wrap it in DATEADD.
Can flesh that out later if you need?
@Naveeduddin , Try a measure like
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
11 | |
10 | |
7 |