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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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?
➤ 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?
➤ 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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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