Forum Discussion
Need help with grouping a variable
- 1 year ago
Hello DomMether ,
Please try the below measure and also request you to share screenshot to check what error you are getting with the measure you are using..
Note - Ensure that the program field is a text field, as numeric data types might not work well with string functions like RIGHT()
Program-Grouped =
SWITCH(
TRUE(),
RIGHT(TRIM([program]), 2) = "01", "January",
RIGHT(TRIM([program]), 2) = "04", "April",
RIGHT(TRIM([program]), 2) = "06", "June","Other")If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
- Anonymous1 year ago
Hi, DomMether
You can try this formula.
Measure = SWITCH( TRUE(), RIGHT(TRIM(SELECTEDVALUE('Table'[Program])), 2) = "01", "January", RIGHT(TRIM(SELECTEDVALUE('Table'[Program])), 2) = "04", "April", RIGHT(TRIM(SELECTEDVALUE('Table'[Program])), 2) = "06", "June", "Other" )Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello DomMether ,
Please try the below measure and also request you to share screenshot to check what error you are getting with the measure you are using..
Note - Ensure that the program field is a text field, as numeric data types might not work well with string functions like RIGHT()
Program-Grouped =
SWITCH(
TRUE(),
RIGHT(TRIM([program]), 2) = "01", "January",
RIGHT(TRIM([program]), 2) = "04", "April",
RIGHT(TRIM([program]), 2) = "06", "June","Other")
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
I can't tell because for some reason I can't reference the column in my DAX formula. Got any idea why that is?
- Anonymous1 year agoNot applicable
Hi, DomMether
You can try this formula.
Measure = SWITCH( TRUE(), RIGHT(TRIM(SELECTEDVALUE('Table'[Program])), 2) = "01", "January", RIGHT(TRIM(SELECTEDVALUE('Table'[Program])), 2) = "04", "April", RIGHT(TRIM(SELECTEDVALUE('Table'[Program])), 2) = "06", "June", "Other" )Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.