The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone!
I need to add a column in my date table that contains the date of the same day of the previous year.
Here is an example:
We see that Tuesday 08/09/2020 last year was Tuesday 10/09/2019.
Year | Month | Day | Same Day Last Year | Day of Week |
2020 | 9 | 08/09/2020 | 10/09/2020 | Tuesday |
Is it possible to do this in Power Query or DAX?
Thanks!
Solved! Go to Solution.
@Anonymous , if you need a column
Date year back = date(year([date]), month([date]), day([date])-364)
@Anonymous , Same weekday day last year is 364 days behind
CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAy))
Use date table.
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9
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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.
Hi @amitchandak , thanks for your answer.
I don't need to create a measure, I need to create a calculated column in my date dimension that shows what the date was for the same week and day of the previous year.
I don't have to have any reference measurements, just my current date.