Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 46 | |
| 42 | |
| 34 | |
| 31 | |
| 21 |
| User | Count |
|---|---|
| 134 | |
| 124 | |
| 98 | |
| 80 | |
| 65 |