March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I've created a measure to pull the finance year exactly 52 weeks ago, but although it evaluates ok, it's only showing me this financial year not last. The reason for this, is because our financial year is being extended to 66 weeks, so week-on-week comparisons are useless! I'll be editing this code to show the weekNo exactly 52 weeks ago too:
TestYear = CALCULATE( MAX('db_v_BaseCalendar_TYLY'[FinYear] ) , FILTER('db_v_BaseCalendar_TYLY', MAX('db_v_BaseCalendar_TYLY'[TransDate]) - (7 * 52))
)
Please can someone see what i'm missing? Thanks all!
Solved! Go to Solution.
@thorpyuk , Not very clear. need example.
See these example with date table and time intelligence
measure
52 week behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))
Week need week Rank for analysis
new column
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
measure
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))
Refer : 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-La...
Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...
@thorpyuk , Not very clear. need example.
See these example with date table and time intelligence
measure
52 week behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))
Week need week Rank for analysis
new column
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
measure
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))
Refer : 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-La...
Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...
Thanks amitchandak, the first one (measure) was what i was after (with some modification) - this is what i did:
CALCULATE( MAX('db_v_BaseCalendar_TYLY'[FinYear] ) , DATEADD('db_v_BaseCalendar_TYLY'[TransDate] , -(52 * 7) , DAY ))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |