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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
prad001
Frequent Visitor

Using Column Names as Slicer Option

I hope you're doing well.

I have a question regarding slicer in Power Bi. Example:  I'm working with a table named "cars" that contains the following columns: Make, model. year and mielage. 

I would like to set up a slicer where the options are the column names themselves-for example, "make" and "model"-instead of values within those columns. When a user selects one or more of these column names in the slicer, the visual below should display all the records where the selected column(s) contain the string value "missing".
Is there a way to achieve this setup in power BI? Any guidance or workaround would be greatly appreciated.

1 ACCEPTED SOLUTION
maruthisp
Solution Specialist
Solution Specialist

Hi @prad001  ,

 

As per your post description, I used DAX expression to handle the scenario.
Please find the attached pbix file for your reference.

Using Column Names as Slicer Option.pbix

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

View solution in original post

4 REPLIES 4
v-veshwara-msft
Community Support
Community Support

Hi @prad001 ,

Thank you for engaging with the Microsoft Fabric Community.

Many thanks to @maruthisp  and @Shravan133  for their prompt and helpful responses to this query.

 

I’ve reviewed and tested the .pbix file shared by @maruthisp , and I can confirm that the provided solutions are accurate and meet the requirements outlined in your query. Please take a moment to review the responses, and feel free to share any feedback or let us know if you need further assistance.

 

If the replies have resolved your issue, kindly consider marking the appropriate response as the Accepted Solution and giving kudos to help others with similar questions.

 

Thank you.

maruthisp
Solution Specialist
Solution Specialist

Hi  @prad001 ,

 

As per your post description, I used DAX expression to handle the scenario.
Please find the attached pbix file for your reference.

Using Column Names as Slicer Option.pbix

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

maruthisp
Solution Specialist
Solution Specialist

Hi @prad001  ,

 

As per your post description, I used DAX expression to handle the scenario.
Please find the attached pbix file for your reference.

Using Column Names as Slicer Option.pbix

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

Shravan133
Super User
Super User

Create a Disconnected Table for Column Selection

In Power BI, go to Modeling > New Table and create this:

MissingColumns =

DATATABLE(

    "ColumnName", STRING,

    {

        { "Make" },

        { "Model" },

        { "Year" },

        { "Mileage" }

    }

)

This will be the source for your slicer.

Create a DAX Measure to Check If a Row Has "Missing" in a Selected Column

Add this measure to your model:

ShowRow =

VAR SelectedColumns = VALUES(MissingColumns[ColumnName])

VAR IsMakeMissing = "Make" IN SelectedColumns && SELECTEDVALUE(Cars[Make]) = "missing"

VAR IsModelMissing = "Model" IN SelectedColumns && SELECTEDVALUE(Cars[Model]) = "missing"

VAR IsYearMissing = "Year" IN SelectedColumns && SELECTEDVALUE(Cars[Year]) = "missing"

VAR IsMileageMissing = "Mileage" IN SelectedColumns && SELECTEDVALUE(Cars[Mileage]) = "missing"

RETURN

IF(IsMakeMissing || IsModelMissing || IsYearMissing || IsMileageMissing, 1, 0)

  1. Apply a Visual-Level Filter on the Table Visual

Now add a table visual to show your Cars data.

Then:

  • Drag the ShowRow measure into the visual’s Filters pane
  • Set filter to ShowRow = 1

Now You Can:

  • Use a slicer on MissingColumns[ColumnName]
  • Select one or more column names (like "Model" and "Mileage")
  • The table will dynamically show rows where either column has the value "missing"

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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