March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Power Bi Community,
I have a special situation here, I have two slicers as you can see below, and the table has data that contains data that includes values from both slicers.
What i need is if i select any values from either slicers, the table should filter to contain only those values:
Exected output for the above selection is:
Column1
-----------
Retailer
Market1
Link to Sample dashboard: https://goanalitica-my.sharepoint.com/:u:/p/priyanka_jha/ETbne82MZRtJipboWHnubJ4BmH4y2mdOYlp3-dKgvFt...
PS: Also, I cannot have one slicer, as my client wants two separate slicers.
Please take a look and let me know if you need anything else.
Look forward to your replies.
@MFelix , @amitchandak , @Greg_Deckler , @tamerj1 , @Jihwan_Kim , @Joe_Barry , @Ashish_Mathur,
Solved! Go to Solution.
Hi @PriyankaJhaTheA ,
If you want to filter a visual by using an OR or "either" approach, the slicer columns must be from a table that doesnt have an active relationshipo to the table being filtered then use a measure to filter it. Here's a sample measure.
Filter =
VAR __T =
VALUES ( 'Table'[Column1] )
VAR __T3 =
VALUES ( 'Table (3)'[Column1] )
--both columns from the above must have the same name
VAR __UNION =
UNION ( __T, __T3 )
RETURN
CALCULATE (
COUNTROWS ( 'Table (2)' ),
KEEPFILTERS ( 'Table (2)'[Column1] IN __UNION )
)
Proud to be a Super User!
Hi @PriyankaJhaTheA ,
If you want to filter a visual by using an OR or "either" approach, the slicer columns must be from a table that doesnt have an active relationshipo to the table being filtered then use a measure to filter it. Here's a sample measure.
Filter =
VAR __T =
VALUES ( 'Table'[Column1] )
VAR __T3 =
VALUES ( 'Table (3)'[Column1] )
--both columns from the above must have the same name
VAR __UNION =
UNION ( __T, __T3 )
RETURN
CALCULATE (
COUNTROWS ( 'Table (2)' ),
KEEPFILTERS ( 'Table (2)'[Column1] IN __UNION )
)
Proud to be a Super User!
Hello @danextian ,
Thanks for providing this solution,
But I have a lot of data in these two filters and now I have added another filter similar to these two.
And I'm using the below code, but it is taking a lot of visual resources to filter the data and in sum cases the query doesn't even executes fully.
Can you help me with a better approach?
Stub Selection =
VAR __T =
VALUES ( 'Data Dict - Stubs - Category'[Mapping for Stubs Filter])
VAR __T3 =
VALUES ( 'Data Dict - Stubs - Shopper'[Mapping for Stubs Filter] )
VAR __T2 =
VALUES ( 'Data Dict - Stubs - Retailer'[Mapping for Stubs Filter] )
--both columns from the above must have the same name
VAR __UNION =
UNION ( __T, __T3 , __T2)
RETURN
CALCULATE (
COUNTROWS ( 'Data Dict - Stubs' ),
KEEPFILTERS ( 'Data Dict - Stubs'[Mapping for Stubs Filter] IN __UNION )
I tested the same measure with data of over 18M rows and categories of over 600K rows and the performance was fine so there could be other factors that's causing the performance issue.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
73 | |
59 | |
57 | |
44 |
User | Count |
---|---|
177 | |
120 | |
83 | |
66 | |
57 |