Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
74 | |
63 | |
51 | |
48 |
User | Count |
---|---|
211 | |
86 | |
64 | |
59 | |
56 |