Forum Discussion
categorical data scenario dax query
- 4 years ago
Hi karma ,
If you don't wish to go with IF condition then you can try SWITCH() in dax. Below is the link for the same.
https://docs.microsoft.com/en-us/dax/switch-function-dax
Please hit the thumbs up & mark it as a solution if this helps you. Thanks.
Hi karma ,
If you don't wish to go with IF condition then you can try SWITCH() in dax. Below is the link for the same.
https://docs.microsoft.com/en-us/dax/switch-function-dax
Please hit the thumbs up & mark it as a solution if this helps you. Thanks.
Thanks for your quick response truptis . Is it possible for you to help me writing the measure?
i have a field -Category and within that field i have A, B, C, D, E, F,G & H and I want to number them as 1,2...8 and if no letter is there then mark it as 0.
- NilR4 years ago
Post Patron
simply follow this :
MEASURE = SWITCH(TRUE(),
A=?, 1,
B=?, 2,C=?, 3,
D=?, 4,
BLANK()
)
OR
MEASURE =
IF(A),1,
IF(B),2,IF(C),3,
IF(D),4,
BLANK()
))))