Forum Discussion
sudanaditya
7 years agoRegular Visitor
DAX formula for the below Sample
Hello Gurus - I am trying to create condition formating on values with below condition
>95 then 1
between 90 to 95 then 2
<90 then 3
Any help is appreciated .
Regards
Sudan
Hi sudanaditya
You may create a measure with IF condition like below:
Condition = IF ( SUM ( 'Sample'[data] ) > 95, 1, IF ( SUM ( 'Sample'[data] ) < 90, 3, IF ( SUM ( 'Sample'[data] ) > 90 && SUM ( 'Sample'[data] ) < 95, 2 ) ) )Regards,
3 Replies
- sudanadityaRegular Visitor
Hello All - Need the Dax formula as I am either getting 1 or 3 when i use switch or IF not sure what I am missing .
Regards
Sudan
- v-cherch-msftMicrosoft Employee
Hi sudanaditya
You may create a measure with IF condition like below:
Condition = IF ( SUM ( 'Sample'[data] ) > 95, 1, IF ( SUM ( 'Sample'[data] ) < 90, 3, IF ( SUM ( 'Sample'[data] ) > 90 && SUM ( 'Sample'[data] ) < 95, 2 ) ) )Regards,
- bviltenHelper III
Unless there is a particular reason for DAX you can use the Conditional Column feature to do it.
Edit Queries > Add Column > Conditional Column.