Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I am looking to compare data on a week on week basis. I have a column in the date table which gives the start of each week on Monday - Sunday -
Solved! Go to Solution.
Hi @yaman123 ,
I create a sample to have a test.
Data model:
Measure:
Raised Tickets =
CALCULATE(COUNT(Table1[Request Time Only]))
Raised Tickets Last Week =
VAR maxSelectedDate =
MAX ( 'Fiscal Calendar'[Date] ) - 7
VAR minSelectedDate =
MIN ( 'Fiscal Calendar'[Date] ) - 7
RETURN
CALCULATE (
COUNT ( 'Table1'[Request Time Only] ),
FILTER (
ALL ( Table1 ),
'Table1'[Request Time Only] >= minSelectedDate
&& 'Table1'[Request Time Only] <= maxSelectedDate
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @yaman123 ,
I create a sample to have a test.
Data model:
Measure:
Raised Tickets =
CALCULATE(COUNT(Table1[Request Time Only]))
Raised Tickets Last Week =
VAR maxSelectedDate =
MAX ( 'Fiscal Calendar'[Date] ) - 7
VAR minSelectedDate =
MIN ( 'Fiscal Calendar'[Date] ) - 7
RETURN
CALCULATE (
COUNT ( 'Table1'[Request Time Only] ),
FILTER (
ALL ( Table1 ),
'Table1'[Request Time Only] >= minSelectedDate
&& 'Table1'[Request Time Only] <= maxSelectedDate
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you! This is working fine!
@yaman123 , Based on what I got. Closed joined with date table having columns like
new columns
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Monday week
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
example 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))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
83 | |
64 | |
60 | |
55 |
User | Count |
---|---|
179 | |
108 | |
105 | |
71 | |
70 |