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
I need to define the number of HW units signed per an accoutn in a dataset where there are multiple line items per account, to ensure that I only have the correct value it needs to comply to various statements. I currently tried the below but that doesn't work I'm getting the error [Expressions that yield variant data-type cannot be used to define calculated columns]
Hi @EllyBrouwers ,
With multiple conditions, you can try && and || (DAX), or AND and OR (M language).
For example,
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The column type can't have mixed data type.
'SDL Deal details Report NWE'[Quantity] - This gives number when TRUE.
"n.a." - This gives text when TRUE.
A work around can be that replace n.a. with 0 so that you get only numeric column.
Another workaround is that 'SDL Deal details Report NWE'[Quantity] gives Text output so that your column is treated as text.
For first case
HW signed = if('SDL Deal details Report NWE'[Category]="Hardware",
if('SDL Deal details Report NWE'[ComponentClass]="printer",
if('SDL Deal details Report NWE'[NetRevenue]>0,
'SDL Deal details Report NWE'[Quantity],0)))
For second case when you want to treat column as text, use FORMAT
= if('SDL Deal details Report NWE'[Category]="Hardware",
if('SDL Deal details Report NWE'[ComponentClass]="printer",
if('SDL Deal details Report NWE'[NetRevenue]>0,
FORMAT('SDL Deal details Report NWE'[Quantity],"General number"),"n.a.")))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |