Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Hoping
Helper III
Helper III

Dynamic Measures based on Slicer Selection

Hi, 

 

I am trying to display multiple measures based on slicer selection in a matrix. 

 

I am using something similar to this solution - https://goodly.co.in/change-measures-using-slicer-powerbi/

 

The SWITCH is based on VALUES in order to allow multiple selection.   This solution works but only in a matrix when I can display each measure selected in a column i.e I can display multiple measures at the same time.

 

In case of a table visualisation, if I choose multiple options, I get an error - A table of multiple values was supplied where a single value was selected.

 

What is the reason it is failing?  As an alternate option I used Field parameters and selected all the insividual measures and added the field parameter to the table as a column. This worked like magic. 

 

Why did my own measure table with a column as measures and SWITCH statement (as shown in the link above) solution not work in a table visualisation ?

 

What is the difference between these solutions ?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Hoping ,

The VALUES function returns a table of values when used in a table context, and when multiple options are selected in a slicer, Power BI attempts to pass a table with multiple values to the SWITCH statement instead of a single value. However, the SWITCH statement is designed to use a single value, not a table of values. This is why you get the error message “A table of multiple values was supplied where a single value was expected” when you try to use the SWITCH statement in a table visualisation.
On the other hand, using field parameters and adding them as columns to the table is effective because it allows you to select multiple measures and display them in a single column. This is because field parameters are designed to accept multiple values and return a single value.

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Hoping ,

The VALUES function returns a table of values when used in a table context, and when multiple options are selected in a slicer, Power BI attempts to pass a table with multiple values to the SWITCH statement instead of a single value. However, the SWITCH statement is designed to use a single value, not a table of values. This is why you get the error message “A table of multiple values was supplied where a single value was expected” when you try to use the SWITCH statement in a table visualisation.
On the other hand, using field parameters and adding them as columns to the table is effective because it allows you to select multiple measures and display them in a single column. This is because field parameters are designed to accept multiple values and return a single value.

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors