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,
I have 'Week' column and it is from 'Week from File Name' which is from Left function(e.g. file name: W10_ABC.xlsx).
So 'Week' column value is not actually from Date related dax calculations.
*sometimes files updated late so I didn't use Week number or Date related function just to align with file name.
I wanna make last week measure to compare last vs current week.
But there are 2 obstacles:
1. Week Number or Date related function wouldn't work because the files sometimes updated late.
e.g. if current week is W13 and file of W12 uploaded this week(uploader forgot and upload late) then this one should be sorted as W12 although it's been actually uploaded at W13.
If we use Date function then it would be sorted as current calendar week as W13 rather than W12.
2. 'Week' column will be filtered by slicer so if we use Filter/All function then last week value couldn't be shown.
So what I want is:
To filter by 'Week' column value:
If I select W12 then W12 data show as this week and W11 data still show as last week.
If I select W10 then W10 data show as this week and W09 data still show as last week.
*Accordingly 'vs Last Week' measure calculations should be aligned.
I've tried Max, Selectedvalues, Rank, etc but still struggling.
Please help!
Solved! Go to Solution.
@jeongkim , if you have a year. Create a new table with Year, week, and year week and year week rank column
Date = Summarize(Table, table[Year], Table[Week No])
new columns
Year Week = [Year]*100 + [Week No]
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
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))
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-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
@jeongkim , if you have a year. Create a new table with Year, week, and year week and year week rank column
Date = Summarize(Table, table[Year], Table[Week No])
new columns
Year Week = [Year]*100 + [Week No]
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
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))
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-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Thanks I think it works!
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 |
---|---|
97 | |
97 | |
82 | |
74 | |
66 |
User | Count |
---|---|
121 | |
105 | |
102 | |
82 | |
72 |