Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello colleague,
Sorry for this stupid-but-simple question
How do I group the date range using DAX and return a value label?
Example : Range date of 1 Jan 2023 to 31 Jan 2023 will be labeled "A". Range date of 1 Feb 23 to 28 Feb 23 will be labeled "B", etc
I already have the date table in my dataset btw.
Thank you!
Solved! Go to Solution.
Then it should be hard coded like
SWITCH (
TRUE ( ),
'Date'[Date] IN CALENDAR ( DATE ( 2023, 01, 03 ), DATE ( 2024, 01, 23 ) ), "A",
etc.
)
Hi @aglpr
you can create a calculated column the date table using switch statement
SWITCH (
MONTH ( 'Date'[Date] ),
1, "A",
2, "B",
etc.
)
or perhaps you need to do that for Year-Month?
Hello Tamer,
Many thanks for your reply. What if the date is specific? (not limited only to the month)
For example 3 Jan 23 to 16 Feb 23 is "A", 17 Feb 23 to 21 Mar 23 is "B"
Thanks again!
Then it should be hard coded like
SWITCH (
TRUE ( ),
'Date'[Date] IN CALENDAR ( DATE ( 2023, 01, 03 ), DATE ( 2024, 01, 23 ) ), "A",
etc.
)
Many thanks Tamer! It works now 🙂
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
22 | |
21 | |
20 | |
14 | |
11 |
User | Count |
---|---|
43 | |
34 | |
25 | |
23 | |
23 |