The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I'm new to Power BI. Can anyone help me on this error, please "Expressions that yield variant data-type cannot be used to define calculated columns"
RemainingSlots = SWITCH( TRUE(),
[Max] = 0, "x",
[Max] - [Min] = 0, "full",
[Max] - [Min] < 0, "less",
[Max] - [Min] > 0, [Max] - [Min]
)
on the last part, I wanted to get the value of the diference of these columns if the difference is >0. Note: it is working without the last part. All column formats are set to Whole Number. not sure what I miss 😞
Thanks in advance!
Solved! Go to Solution.
You are trying to return both text and numbers in that column,
RemainingSlots = SWITCH( TRUE(),
[Max] = 0, "x",
[Max] - [Min] = 0, "full",
[Max] - [Min] < 0, "less",
[Max] - [Min] > 0, FORMAT([Max] - [Min],"#")
)
You are trying to return both text and numbers in that column,
RemainingSlots = SWITCH( TRUE(),
[Max] = 0, "x",
[Max] - [Min] = 0, "full",
[Max] - [Min] < 0, "less",
[Max] - [Min] > 0, FORMAT([Max] - [Min],"#")
)