Forum Discussion
Irwin
Helper IV
4 years agoIf with multiple values // changing data to 0,1 or 2
Hi Guys, I would like to create a new coloum where I change my data to three values. Either 0 (=Blanks) or 1 (=everything between 0-100) or 2 (=everything above 100). I have tried if statemen...
- 4 years ago
Hi Irwin ,
Try creating a calculated column like this:
IF('Table'[Column]=BLANK(),0,IF('Table'[Column]<101,1,IF('Table'[Column]>100,"2",BLANK())))JoriIf I answered your question, please mark it as a solution to help other members find it more quickly.
Connect on Linkedin
jppv20
Solution Sage
4 years agoHi Irwin ,
Try creating a calculated column like this:
IF('Table'[Column]=BLANK(),0,
IF('Table'[Column]<101,1,
IF('Table'[Column]>100,"2",
BLANK())))
Jori
If I answered your question, please mark it as a solution to help other members find it more quickly.
Connect on Linkedin
Connect on Linkedin
Irwin
Helper IV
4 years agoHi again...
I tried rewriting it since I read that PBI thinks =Blank() also includes 0. See this post:
https://community.powerbi.com/t5/Desktop/DAX-treats-0-as-BLANK-how-to-prevent-it/m-p/342272
When I use the below it works. Thank you again.
Measure =
IF (
ISBLANK('Table'[column]),0,
IF (
'Table'[column] < 1,
1,
IF ( 'Table'[column] >= 1, 2, BLANK () )
)
)