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
Hi,
I am getting error "The Expression Refers to Multiple Columns. Multiple Columns Cannot Be Converted to a Scalar Value."
in below function
Solved! Go to Solution.
Hi @Anonymous
I think you'd be better off using the SELECTEDVALUE function, as per below.
Select Metric =
VAR SelMetric = SELECTEDVALUE ( 'Metric ' )
VAR Result =
SWITCH (
TRUE (),
SelMetric = "Sales($)", ROUND ( [Select Sales], 0 ),
SelMetric = "Vol", ROUND ( [Select Trans], 0 ),
SelMetric = "customers", ROUND ( [Cust], 0 ),
SelMetric = "Sales Conversion(%)", ROUND ( [Sales Conversion], 0 ),
SelMetric = "AVG VOL($)", ROUND ( [Avg Vol], 0 ),
SelMetric = "Exit", ROUND ( [Exit], 0 ),
BLANK ()
)
RETURN
Result
Best regards,
Martyn
Hi @Anonymous
I think you'd be better off using the SELECTEDVALUE function, as per below.
Select Metric =
VAR SelMetric = SELECTEDVALUE ( 'Metric ' )
VAR Result =
SWITCH (
TRUE (),
SelMetric = "Sales($)", ROUND ( [Select Sales], 0 ),
SelMetric = "Vol", ROUND ( [Select Trans], 0 ),
SelMetric = "customers", ROUND ( [Cust], 0 ),
SelMetric = "Sales Conversion(%)", ROUND ( [Sales Conversion], 0 ),
SelMetric = "AVG VOL($)", ROUND ( [Avg Vol], 0 ),
SelMetric = "Exit", ROUND ( [Exit], 0 ),
BLANK ()
)
RETURN
Result
Best regards,
Martyn
Excellent Mate, Thanks Much
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 35 | |
| 34 | |
| 32 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 96 | |
| 77 | |
| 67 | |
| 65 |