This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I have a calendar (Calendar linked to my data). I want to have the ability within my data to set date ranges, for example I have a table that shows a set of data that I need to report on but I want to set it within a couple of date ranges including prev>Sat and less than Prev Friday. Can anyone help with this and any other examples for days?
Solved! Go to Solution.
Hi @jaltoft
The information you provide is not very clear, so there is no way to create a sample exactly according to your needs. I created a similar sample, you can refer to it .
(1)Create a Calendar date table from “2021-01-01” to “2021-03-30” .
Calendar Date = CALENDAR(DATE(2021,01,01),DATE(2021,03,30))
(2)Create a column to return the week number for each date in Calendar date table .
week num = WEEKNUM('Calendar Date'[Date])
(3)Create a column to return the ranges by column [week num]
range = SWITCH(TRUE(),'Calendar Date'[week num]>=1 && 'Calendar Date'[week num]<2,"1 to 2 week",
'Calendar Date'[week num]>=2 && 'Calendar Date'[week num]<3,"2 to 3 week",
'Calendar Date'[week num]>=3 && 'Calendar Date'[week num]<4,"3 to 4 week",
'Calendar Date'[week num]>=4 && 'Calendar Date'[week num]<5,"4 to 5 week",
'Calendar Date'[week num]>=5 && 'Calendar Date'[week num]<6,"5 to 6 week", "others")
The final result is as shown :
I have attached my pbix file .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jaltoft
The information you provide is not very clear, so there is no way to create a sample exactly according to your needs. I created a similar sample, you can refer to it .
(1)Create a Calendar date table from “2021-01-01” to “2021-03-30” .
Calendar Date = CALENDAR(DATE(2021,01,01),DATE(2021,03,30))
(2)Create a column to return the week number for each date in Calendar date table .
week num = WEEKNUM('Calendar Date'[Date])
(3)Create a column to return the ranges by column [week num]
range = SWITCH(TRUE(),'Calendar Date'[week num]>=1 && 'Calendar Date'[week num]<2,"1 to 2 week",
'Calendar Date'[week num]>=2 && 'Calendar Date'[week num]<3,"2 to 3 week",
'Calendar Date'[week num]>=3 && 'Calendar Date'[week num]<4,"3 to 4 week",
'Calendar Date'[week num]>=4 && 'Calendar Date'[week num]<5,"4 to 5 week",
'Calendar Date'[week num]>=5 && 'Calendar Date'[week num]<6,"5 to 6 week", "others")
The final result is as shown :
I have attached my pbix file .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@jaltoft , if you are planning set default for date ranges, that is not possible as of now.
You need to have slicers like this examples column and save that on this week
Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today(),"This Week" ,
[start week]<=Today()-7 && [end date]>=Today()-7,"Last Week" ,
[Week Name]
)
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
refer if needed
Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 25 | |
| 23 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 50 | |
| 30 | |
| 24 | |
| 23 |