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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Zyg_D
Continued Contributor
Continued Contributor

Not showing data in slicer if corresponds to empty results

This is my data: 
data.PNG
model.PNG

And the report view (slicer + table): 
report.PNG
(the slicer is based on Table2[category])

The question: is there a way not to show "112" in the slicer if I do not have corresponding data in the related Table1? 
This is very simplified data, so I need an answer which will not include these
- creating a slicer based on Table1[category]
- explicitly filtering out "112" in filters pane

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Zyg_D , Create a measure in your fact .

 

M1= count(Table1[Category])

 

And put that into the visual level filter of Category from Table2 , check M1 is not blank

 

You can this video if needed, this for 2 slicers, but the logic is same - https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

View solution in original post

Zyg_D
Continued Contributor
Continued Contributor

A filter + measure count(Table1[Category]) really works - thanks, @amitchandak
amit_solution.PNG

Also, I was able to find my own solution, using only a filter based on Table1[sub_cat]) 
filter.PNG

View solution in original post

4 REPLIES 4
Zyg_D
Continued Contributor
Continued Contributor

A filter + measure count(Table1[Category]) really works - thanks, @amitchandak
amit_solution.PNG

Also, I was able to find my own solution, using only a filter based on Table1[sub_cat]) 
filter.PNG

Anonymous
Not applicable

The Show items with no data feature enables you to do exactly that - include data rows and columns that don't contain measure data (blank measure values).

To enable the Show items with no data feature select a visual, then in the Fields well, right-click the field and select Show items with no data from the menu that appears.

The Show items with no data feature does not have effect in the following circumstances:

  • There's no measure added to the visual, and the grouping columns come from the same table
  • Groups are unrelated; Power BI doesn't run queries for visuals that have unrelated groups
  • The measure is unrelated to any of the groups; this is because the measure will never be blank for only some group combinations
  • There's a user-defined measure filter that excludes blank measures - for example: SalesAmount > 0
sreenub
Resolver II
Resolver II

amitchandak
Super User
Super User

@Zyg_D , Create a measure in your fact .

 

M1= count(Table1[Category])

 

And put that into the visual level filter of Category from Table2 , check M1 is not blank

 

You can this video if needed, this for 2 slicers, but the logic is same - https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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