Forum Discussion
Problem with comparing two CALCULATEDTABLES & with MAX WEEK
serax , for this, it is best to create a separate year week table with year week (YYYY-WW), year and week. Say date
have rank column in date table
Week Rank RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
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
- serax4 years agoFrequent Visitor
Hello amitchandak
Your proposed solution by using RANK solved my MAX_WEEK issue - thanks! But still I have no clue how to compare two calculated tables.Best regards!
- Anonymous3 years agoNot applicable
HI serax,
Perhaps you can try to use ADDCOLUMNS and LOOKUPVALUE functions to add new table columns to the current table based on id.
ADDCOLUMNS function (DAX) - DAX | Microsoft Learn
LOOKUPVALUE function (DAX) - DAX | Microsoft Learn
Regard,
Xiaoxin Sehng