Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |