Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
So I have 3 years worth sales data in the sales table. I want to be able to compare the last 5 weeks and 13 weeks to the same period last year. I have a calendar table that manages all my date info. I can not figure out how to compare to the previous periods. I have attached a sample of both my date and sales data tables.
Thanks for the help.
Solved! Go to Solution.
@jwininger Check out this article at SQLBI that is amost tailor written to your question. You aready have the TRUE/FALSE columns for the 13 and 5 week periods, and the article addresses both the current and prior year (same period last year) calculations.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@jwininger Check out this article at SQLBI that is amost tailor written to your question. You aready have the TRUE/FALSE columns for the 13 and 5 week periods, and the article addresses both the current and prior year (same period last year) calculations.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThanks so much. That article was exactly what I was looking for.
When you're looking at dates grouped into weeks you have to be careful because weeks can span months and years. So this really only works if you're looking at the week-level in your data - it will return the same value for all days in a specific week if you're looking at a specific date (i.e. if 1/9 and 1/10 are in the same week you'll get the same value returned).
Here's one solution:
In your Date table create two new calculated columns:
YearKey = YEAR('Date'[Date])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |