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
Wiene24
Helper II
Helper II

Smart Slicer

Hi,

 

Is it possible to make a slicer smarter?

 

I have a database with clients and with invoice amounts.

 

I have a slicer with years, but now I want that the slicer where I can select a certain client takes in notice that clients without any data in that year are not shown.

 

We have alot of one time clients, because of this the slicer is getting extremely big.

 

I have added the Text Filter app as visualisation but I have had this 'problem' with more reports.

 

Kind Regads,

 

Tim Wijnen

1 ACCEPTED SOLUTION

Hi @Wiene24,

 

The custom visual "HierarchySlicer" is the solution. It has a Value filed where we can add a measure to filter the values. Please refer to the demo below. Some items are filtered out by the measure. 

SlicerOnly =
VAR temp =
    SUM ( Sales[SalesQuantity] )
RETURN
    IF ( temp >= 100000, temp, BLANK () )

Smart-Slicer2

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-jiascu-msft
Employee
Employee

Hi Tim,

 

There is a workaround. Add a Calculated Column to the table where the client is from. For example, if there aren't any sales in the [Sales] table, the column will be blanks. 

Column =
IF (
    ISBLANK ( SUMX ( RELATEDTABLE ( Sales ), [SalesQuantity] ) ),
    BLANK (),
    [ColorName]
)

Smart-Slicer

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Dale,

 

The problem is that there is data in the sales table from almost all clients, but I want that if I select 2017 that only the clients that had sales in 2017 will show. If I then change it to 2018 I only want to see the clients that had sales in 2018.

 

Because we have alot of one time sales they will now always stay in my slicer.

Hi @Wiene24,

 

The custom visual "HierarchySlicer" is the solution. It has a Value filed where we can add a measure to filter the values. Please refer to the demo below. Some items are filtered out by the measure. 

SlicerOnly =
VAR temp =
    SUM ( Sales[SalesQuantity] )
RETURN
    IF ( temp >= 100000, temp, BLANK () )

Smart-Slicer2

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

When I first started using this slicer it worked even without the Value field.

But I think something changed that it doesn't work anymore, for any of my reports.

I didnt look at the measure yet because I didn't need it. I cant use the VAR temp and Return. They just don't excist.

 

Is there any other way I can make the slicer that smart that it only shows values that are active in the report?

Thanks Dale that is the perfect slicer!

 

Kind regards,

 

Tim

Greg_Deckler
Super User
Super User

There may be something in the marketplace in terms of a smarter slicer but I'm not aware of a way to do that because you can't use filters on a slicer and you can't use measures as filters in page or report filters.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors