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.
Hi Community,
I once again need your expert guidance. I am working with sales volumes for a planning report. I succesfully used
Solved! Go to Solution.
Thanks to both of you, I combined your two approaches for the current implementation I use. I already have a calendar table I could utilise and did the following:
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),FILTER(Dim_Date,Dim_Date[YEAR] = MAX(Dim_Date[YEAR])-1 && Dim_Date,Dim_Date[WEEKNUM] = MAX(Dim_Date[WEEKNUM]) && Dim_Date[WEEKDAY] = MAX(Dim_Date[WEEKDAY])))
It takes the Sum() for the same day of the same week one year earlier.
Thanks to both of you, I combined your two approaches for the current implementation I use. I already have a calendar table I could utilise and did the following:
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),FILTER(Dim_Date,Dim_Date[YEAR] = MAX(Dim_Date[YEAR])-1 && Dim_Date,Dim_Date[WEEKNUM] = MAX(Dim_Date[WEEKNUM]) && Dim_Date[WEEKDAY] = MAX(Dim_Date[WEEKDAY])))
It takes the Sum() for the same day of the same week one year earlier.
Hi @Anonymous ,
I would suggest you create a calendar table with weeknum and weekday columns:
Dim_Date = ADDCOLUMNS(CALENDAR(DATE(2019,1,1),DATE(2020,12,31)),"WEEKNUM",WEEKNUM([Date]),"WEEKDAY",WEEKDAY([Date],2))
Then you can get week day last year by the following measure:
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),FILTER(Dim_Date,Dim_Date[WEEKNUM] = MAX(Dim_Date[WEEKNUM&&Dim_Date[WEEKDAY] = MAX(Dim_Date[WEEKDAY])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous , Same week day is last year 364 days behind. Try a measure like this with help from date table
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))
Also refer Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8
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 |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |