Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I have this 1 table that I would like to create an IF, ELSE column (or a measure) to replace the REGULAR PRICE
| ITEM | REGULAR PRICE | DISCOUNTED |
| BANANA | $5 | |
| APPLE | $10 | |
| MANGO | $20 |
If discounted=YES, then the price column becomes $1. If discounted=NO, then regular price.
Thanks.
Solved! Go to Solution.
Hello @vojtechsima ,
Thanks for the prompt reply. I get an error message. (DAX comparison operations do not support comparing values of type True?False with values of type Text.)
Hi, @Oros ,
Make sure your columns are in proper data types, when comparing string ("YES", "NO") the column has to be a text, if numeric values (1,2) it has to be Numeric. PLease check that and try running itagain
Hello @vojtechsima ,
I change it to text but got another error:
"Expressions that yield variant data-type cannot be used to define calculated columns."
Any idea?
Thanks.
Hello @Oros ,
Add a calculated column-
NewColumn = IF(Data[DISCOUNTED]="YES",1,Data[REGULAR PRICE])
Please mark it as answer if it resolves your issue. Kudos are also appreciated.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 30 | |
| 26 | |
| 25 |