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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
konno
Frequent Visitor

How to Get Multiple Selected Value From Slicer in Power BI

(I pressed the resolution button by mistake.)

Hello,

Please share your ideas on how to Get Multiple Selected Value From Slicer in Power BI.

If something is selected in the “category” slicer, we would like to display the selected value. in the image, “fruit” and “meat” are selected, so “category=fruit,meat” is displayed.

konno_3-1727432288267.png

However, if I select “fruit” and “meat” in the “category” slicer and then select “apple” in the “food” slicer, “category=fruit” will be displayed.
I would like to display “category=fruit,meat”, so please share your ideas.

konno_0-1727432341215.png


This is the current DAX formula.

 

 

category_text =
VAR category_text =
    IF(
        ISFILTERED(foodList[category]),
        "category = " & CONCATENATEX(ALLSELECTED(foodList[category]), foodList[category], ","),
        ""
    )

RETURN
    IF(category_text = "", "Slicer not selected", category_text)
food_text = 
VAR selected_text = 
    IF(
        ISFILTERED(foodList[food]),
        "food = " & CONCATENATEX(ALLSELECTED(foodList[food]), foodList[food], ","),
        ""
    )

RETURN
    IF(selected_text = "", "Slicer not selected", selected_text) 

 

 

 

 

 

 




1 ACCEPTED SOLUTION

Thanks for the reply @v-yaningy-msft.

For example, try the following order.
①Select “fruit” and “meat” in the “category” slicer.
② Select only "banana" in the “food” slicer

In this case, I want to display “category=fruite,meat  food=banana”, but actually it is displayed as “category=fruite  food=banana”. “meat” disappears.

konno_2-1727684670362.png

 

 

View solution in original post

12 REPLIES 12
v-yaningy-msft
Community Support
Community Support

Hi, @konno 

You can try to create additional Category table.

vyaningymsft_1-1727686374234.pngvyaningymsft_2-1727686385624.png

vyaningymsft_0-1727686294290.png

selected_text = 
VAR category_text = 
    IF(
        ISFILTERED(Category[category]),
        "category = " & CONCATENATEX(ALLSELECTED(Category[category]), Category[category], ","),
        ""
    )
VAR food_text = 
    IF(
        ISFILTERED(foodList[food]),
        "food = " & CONCATENATEX(ALLSELECTED(foodList[food]), foodList[food], ","),
        ""
    )
RETURN
    IF(category_text = "" && food_text = "" ,
        "Slicer not selected",
        ""
    ) &
    IF(category_text <> "", category_text & "<br>", "") &
    IF(food_text <> "", food_text & "<br>", "") 

 

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Thanks for the reply @v-yaningy-msft .

That is a good idea, but there is one problem. The report I am trying to create has more than 3 slicers. For example, I would add a “stock” slicer. Then when I select the “stock” slicer, the “category” slicer is not filtered.

konno_3-1727689525006.png

konno_4-1727689588285.png

v-yaningy-msft
Community Support
Community Support

Hi, @konno 

Used your Measure and it seems to be working fine, not sure what you're missing or if I'm wrong about your needs (Interaction effects that do not change the visual object).

vyaningymsft_0-1727682048040.png

 

selected_text = 
VAR category_text = 
    IF(
        ISFILTERED(foodList[category]),
        "category = " & CONCATENATEX(ALLSELECTED(foodList[category]), foodList[category], ","),
        ""
    )
VAR food_text = 
    IF(
        ISFILTERED(foodList[food]),
        "food = " & CONCATENATEX(ALLSELECTED(foodList[food]), foodList[food], ","),
        ""
    )
RETURN
    IF(category_text = "" && food_text = "" ,
        "Slicer not selected",
        ""
    ) &
    IF(category_text <> "", category_text & "<br>", "") &
    IF(food_text <> "", food_text & "<br>", "") 

 

 

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Thanks for the reply @v-yaningy-msft.

For example, try the following order.
①Select “fruit” and “meat” in the “category” slicer.
② Select only "banana" in the “food” slicer

In this case, I want to display “category=fruite,meat  food=banana”, but actually it is displayed as “category=fruite  food=banana”. “meat” disappears.

konno_2-1727684670362.png

 

 

powerbiexpert22
Post Prodigy
Post Prodigy

Hi @konno ,

 

please try below approach 

 

https://www.youtube.com/watch?v=M9sbRXuFtCM

 

 

Thanks for sharing the video @powerbiexpert22 .

https://youtu.be/R7UNCPHQDxk?si=kKIDY7omcHaUzh86 
In the comments of the video you shared with us, there was an interesting video URL. However, even this video doesn't seem to solve the problem. I tried the same DAX formula.
I think the data used by Mr.BI Tricks is all the data that exists for the “Product” and “Country” combination, as shown in the image. I think that is why all “Products” are displayed even if I unchecked France and Germany.

konno_0-1727687290013.png

konno_2-1727687344404.png



Ritaf1983
Super User
Super User

Hi @konno 
Switch off the interaction between the card and the food slicer and your formula will work .

Ritaf1983_0-1727462160701.png

Result :

Ritaf1983_1-1727462197565.pngRitaf1983_2-1727462229346.png

The pbix with the examples is attached

I also recommend disabling the interaction from "Food" to "Category" to maintain the correct hierarchical order in filtering. The category should filter the food, but the food shouldn't filter the category; otherwise, you may end up with strange views like :

Ritaf1983_4-1727462471713.png

If my answer was helpful please give me a Kudos and accept as a Solution.



Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hello @Ritaf1983 
Thanks for the reply.
I'm sorry I didn't explain it well.

Ultimate goal is to display using a custom visual “HTML Content (lite)”. I want to display all the slicer values in one visual, so I can't switch off the interaction.

I would like to display all the slicers, assuming there are actually 10 slicers.

konno_2-1727660309891.png

 

selected_text = 
VAR category_text = 
    IF(
        ISFILTERED(foodList[category]),
        "category = " & CONCATENATEX(ALLSELECTED(foodList[category]), foodList[category], ","),
        ""
    )

VAR food_text = 
    IF(
        ISFILTERED(foodList[food]),
        "food = " & CONCATENATEX(ALLSELECTED(foodList[food]), foodList[food], ","),
        ""
    )

VAR stock_text = 
    IF(
        ISFILTERED(foodList[stock]),
        "stock = " & CONCATENATEX(ALLSELECTED(foodList[stock]), foodList[stock], ","),
        ""
    )

RETURN
    IF(category_text = "" && food_text = "" && stock_text = "",
        "Slicer not selected",
        ""
    ) &
    IF(category_text <> "", category_text & "<br>", "") &
    IF(food_text <> "", food_text & "<br>", "") &
    IF(stock_text <> "", stock_text & "<br>", "")

 


If you have good idea, please let me know.
I can't attach a sample report because I don't have the authority to do so.

Hi @konno
I don't understand why interaction between the first slicer and the second visualization is needed, regardless of what it will eventually turn into. In any case, I'm doubtful that this can work as long as the category and food table is a single table. I don't see an option here to disconnect the filtering only with DAX, so it can either happen by turning off the interaction as I showed, or by creating a separate table without the food relationship. Then, in the cases where both slicers need to be considered together, you can combine them within the DAX calculation.

If my answer was helpful please give me a Kudos and accept as a Solution.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for the quick reply @Ritaf1983.

I want to display the values of all slicers (category,food,stock) so I can't switch the interaction off.

konno_1-1727663452836.png

 


by creating a separate table without the food relationship. Then, in the cases where both slicers need to be considered together, you can combine them within the DAX calculation.
>>I am interested in this idea. Is it possible for you to tell us more about it?


Hi @konno 
I tried to play around with it just now, and I also don’t see that the separation really helps, because it causes other issues, like difficulty in creating proper interaction between the slicers. I hope someone else can solve the problem for you, as I have to surrender 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for trying to resolve this. It was helpful.
I will try it myself.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.