Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I have a dataset with a following structure.
I want to insert a conditional column which would say: if kwh = o and duration > 2, then tell "bad", otherwise "ok"
| Clients | kwh | duration |
| a | 0 | 0 |
| b | 0 | 0 |
| c | 10 | 15 |
| d | 0 | 589 |
| e | 55 | 10 |
| f | 0 | 14 |
| g | 2 | 10 |
| h | 1 | 10 |
| i | 0 | 3 |
I have tried multiple options from conditional columns, to DAX as well as creating a column.
Nothing works for me.
Power BI Forums were of no help to me.
Thanks and BR
Solved! Go to Solution.
Hi, @taurius2022
Please try formula as below:
Calculated column:
Column = if('Table'[kwh]=0&&'Table'[duration]>2,"bad","ok")
Meaure:
Measure = if(MAX('Table'[kwh])=0&&MAX('Table'[duration])>2,"bad","ok")
Best Regards,
Community Support Team _ Eason
Hi, @taurius2022
Please try formula as below:
Calculated column:
Column = if('Table'[kwh]=0&&'Table'[duration]>2,"bad","ok")
Meaure:
Measure = if(MAX('Table'[kwh])=0&&MAX('Table'[duration])>2,"bad","ok")
Best Regards,
Community Support Team _ Eason
Calculated column (had this before) : DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values. --> #Error
Measure:
I have changed the format of data --> kwh : from text to numers.
Now it works.
Thanks
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |