Forum Discussion
Anonymous
4 years agoNot applicable
Date Range grouping
Hello, I am trying to group tansactions by date ranges from day selected. I am using the code below to create the categories but I keep getting the "60+ days" and no other categories. Can someo...
- 4 years ago
Anonymous well you tweak the code as it fits for you, I just provided the solution based on your original question.
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
parry2k
4 years agoSuper User
Anonymous TRY THIS:
Grouping =
Var Tabledate = DATEDIFF(Date],TODAY(),Day)
Return
SWITCH ( TRUE() ,
TableDate>=61, "60+ Days",
Tabledate>=30, "30-60 days",
Tabledate>=23, "23-29 days",
Tabledate>=16, "16-22 days",
Tabledate>=6, "6-15 days",
Tabledate>=3, "3-5 days",
Tabledate>=1, "1-2 days",
"Less than 1 Day"
)
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.