Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
(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.
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.
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)
Solved! Go to 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.
Hi, @konno
You can try to create additional Category table.
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.
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).
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.
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.
Hi @konno
Switch off the interaction between the card and the food slicer and your formula will work .
Result :
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 :
If my answer was helpful please give me a Kudos and accept as a Solution.
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.
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.
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.
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 🙂
Thanks for trying to resolve this. It was helpful.
I will try it myself.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
84 | |
64 | |
52 | |
49 |
User | Count |
---|---|
211 | |
87 | |
80 | |
69 | |
60 |