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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
chari7595
Regular Visitor

slicer with subset of a column

Hello,

 

I have a data of 4 columns of data types : date, string, int & float. string contains about 20 different items.

I need to insert a slicer that allows to select only a subset of those 20, about 6 of them. The remaining should not be seen or be accessible. And I would like to do that by adding a new column. If I should add or remove I would do that in the new column.

 

Please help.

Thanks Power BI community!

3 REPLIES 3
Sahir_Maharaj
Super User
Super User

Hello @chari7595,

 

You can create a new column in your data model that identifies the subset of items you want to include in your slicer. E.g.

SlicerColumn = IF(
    OR(
        Table[ItemColumn] = "Item1",
        Table[ItemColumn] = "Item2",
        Table[ItemColumn] = "Item3",
        Table[ItemColumn] = "Item4",
        Table[ItemColumn] = "Item5",
        Table[ItemColumn] = "Item6"
    ),
    Table[ItemColumn],
    BLANK()
)

 

Should you have any questions or further assistance, please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Thanks but i do have to ask this. What is the function of OR in the syntax ?

@chari7595 The OR function is checking to see if Table[ItemColumn] equals any of the items ("Item1", "Item2", "Item3", ....).

 

If Table[ItemColumn] matches any of these items, the OR function returns TRUE and the SlicerColumn will be assigned the value of Table[ItemColumn].


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors