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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jonclay
Helper IV
Helper IV

If field contains data = Yes, otherwise No

Hi everyone

I would like to have a slicer that contains Yes and No options which filter my table depending on whether a specific fields contain data or not (in this case the field is Street1).

So, if Street1 contains e.g. 20 High Street then the data will show in the table if the Slicer option of Yes is ticked. Conversely, it won't appear if the Slicer option of No is selected.

I started by adding a new Conditional Column against each record, but I feel there must be a better and more efficient way of doing this using DAX. I'd really appreciate any help that you could give me.

Many thanks
Jon

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

For this, if you want to use a slicer for Yes or No, the simplest solution is a calculated column along the lines of:

Contains Street? = IF(ISBLANK(Table[Street1]), "No", "Yes")

you then use this column for the slicer.

You can actually achieve this using DAX and a table containing values for Yes or No, but it is rather convoluted...

Or you can simply use the filter pane instead of a slicer (and no calculated column)

Or use buttons and bookmarks





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

For this, if you want to use a slicer for Yes or No, the simplest solution is a calculated column along the lines of:

Contains Street? = IF(ISBLANK(Table[Street1]), "No", "Yes")

you then use this column for the slicer.

You can actually achieve this using DAX and a table containing values for Yes or No, but it is rather convoluted...

Or you can simply use the filter pane instead of a slicer (and no calculated column)

Or use buttons and bookmarks





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you so much, @PaulDBrown , that worked a treat 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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