The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
136 | |
114 | |
109 | |
72 | |
57 |
User | Count |
---|---|
234 | |
126 | |
116 | |
96 | |
92 |