Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |