March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello, i have a calendar table like this, my date starts from 1/1/21 and ends on 31/12/2022.
what i want to do is create a separate column that groups my date according to the week that they belong in. for example
if i select a particular week range, like 2nd to 3rd week, the date on the horizontal axis shows only the dates belonging to the particular range like( 2nd to 3rd week should show dates from 4/1/2021-17/1/2021.
like this, it has nothing in it right now but i just wanted to show what i was thinking of doing.
is there any way to do that?
Solved! Go to Solution.
Hi @Aryaja96 ,
Please create these.
Table.
Table =
DISTINCT (
SELECTCOLUMNS (
CALENDAR ( MIN ( 'Calendar'[Date] ), MAX ( 'Calendar'[Date] ) ),
"Start", WEEKNUM ( [Date], 2 ),
"End", WEEKNUM ( [Date], 2 ) + 1
)
)
Calculated column.
Column = [Start] & " to " & [End] & " Week"
Measure.
Measure =
VAR _weeknum = MAX('Calendar'[Week of Year])
VAR _start = MAX('Table'[Start])
VAR _end = MAX('Table'[End])
VAR _result = IF(_weeknum>=_start&&_weeknum<=_end,1)
RETURN
_result
Configure filters.
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @Aryaja96 ,
Please create these.
Table.
Table =
DISTINCT (
SELECTCOLUMNS (
CALENDAR ( MIN ( 'Calendar'[Date] ), MAX ( 'Calendar'[Date] ) ),
"Start", WEEKNUM ( [Date], 2 ),
"End", WEEKNUM ( [Date], 2 ) + 1
)
)
Calculated column.
Column = [Start] & " to " & [End] & " Week"
Measure.
Measure =
VAR _weeknum = MAX('Calendar'[Week of Year])
VAR _start = MAX('Table'[Start])
VAR _end = MAX('Table'[End])
VAR _result = IF(_weeknum>=_start&&_weeknum<=_end,1)
RETURN
_result
Configure filters.
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |