Forum Discussion
TungNguyen_19
Helper III
3 years agoHow to make conditional formula on mixed type column?
Hello everyone,
I have the column with data like this:
| Charge |
| 3509 |
| 4400 |
| No Charge |
| 6000 |
I want to make the calculated column with the formula like this:
IF([Charge] =" No Charge", 0, IF([Charge]>500, [Charge]/24,[Charge]))
But the type of the Charge column is Text so the formula can not be done, please help me.
Thank you ❤️
3 Replies
- MFelix
Super User
Hi TungNguyen_19 ,
On the query editor you can do the following code:
if [#"Charge "] = "No Charge" then 0 else if Number.FromText ([#"Charge "]) > 50 then Number.FromText([#"Charge "]) / 24 else Number.FromText([#"Charge "])- TungNguyen_19
Helper III
Hi MFelix
Is there any way to do this in DAX? Because the table come from database and I don't have credential to modify it on Power Query. So I'm only can work around in Power Desktop by using DAX.
Thank you ❤️
- MFelix
Super User