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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

selectedvalue/allselected for multiple values

I created this measure and slice by a slicer:
Q3 TEST3 = CALCULATE(COUNTROWS ('Q3'), FILTER(ALLEXCEPT(Q3,Q3[Gender],Q3[Age],Q3[Employment],Q3[Tenure]),Q3[Facility Name]=ALLSELECTED(Demographics[Facility Name])))
 
However, only one value is able select. If i select multiple values in the slicer, it will return error. Same case for selectedvalue/allselected.
 
How could I solve the issue? My final visual target is bar chart
3 REPLIES 3
achanikya
Helper I
Helper I

@Anonymous @Anonymous 

 

The reason why your measure is only able to select one value is that it uses the ALLSELECTED function, which returns a single value when multiple items are selected in the slicer.

To allow for multiple values to be selected in the slicer, you can modify your measure to use the VALUES function instead of ALLSELECTED. Here's an updated version of your measure:

Q3 TEST3 = CALCULATE( COUNTROWS('Q3'), FILTER( ALLEXCEPT(Q3, Q3[Gender], Q3[Age], Q3[Employment], Q3[Tenure]), Q3[Facility Name] IN VALUES(Demographics[Facility Name]) ) )

This modified measure uses the IN operator and the VALUES function to filter the data based on the selected values in the Demographics[Facility Name] slicer. The VALUES function returns a table of the selected values in the slicer, which can include multiple values.

Once you have updated your measure, you can use it in a bar chart visual along with the Demographics[Facility Name] field in the Axis section to create the bar chart you desire.

Anonymous
Not applicable

Hello,

 

The issue here is tthat it is using the ALLSELECTED function which returns a single value for the selected item in the slicer. If you select multiple items in the slicer, it will return an error because the ALLSELECTED function cannot return multiple values.

 

To solve this issue, you can use the VALUES function instead of ALLSELECTED function in your measure.

 

Thanks,

Anonymous
Not applicable

The VALUES function works. Another further problem is that i would like to use it for multiple slicer. I have tried to use

VALUES(Demographics[Facility Name] || 
VALUES(Demographics[Gender]
But it seems not work

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.