Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |