Forum Discussion
Dynamic date difference
- 1 year ago
Hello Dodo96
DAX for calculated column
Date Range Category =
VAR SelectedMaxDate =
CALCULATE (
MAX ( 'Calendar'[Date] ),
ALLSELECTED ( 'Calendar' )
)
VAR DaysDiff =
DATEDIFF ( Table1[Date], SelectedMaxDate, DAY )
RETURN
SWITCH (
TRUE(),
DaysDiff <= 30, "Within 30 days",
DaysDiff <= 60, "31 to 60 days",
DaysDiff > 60, "Over 60 days",
BLANK()
)
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Hi Dodo96 ,
Thanks for reaching out to the Microsoft fabric community forum.
I have tried out the DAX measure mentioned by pankajnamekar25 and and it successfully produces the expected output.
Here is the output with my sample data
Please try it out and let us know if you have any issues.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you