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

Be 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

Reply
Anonymous
Not applicable

Direct and Inverse Selector

Hello,

I have a table like this:

Department     Product     Category

Sports                 AA                00001

Education            BB                00002

Health                 AB                00003

Sports                 AA                00004

Health                 BB                00005

 

I need a slicer for Product that will act as both direct and inverse slicer.

Eg:- If I select Product 'BB' in slicer -> It should display 2 tables.

1st  : Department and Category that HAS product BB

2nd : Department and Category that DOES NOT HAVE product BB

 

Is there a way to acheive this?

 

Thanks

1 ACCEPTED SOLUTION

Right, so create a disconnected table like this:

 

Table6 = ALL('Table5'[Product])

Use this for your slicer. Then, create these two measures and use them in your tables. 

 

Normal Measure = 
VAR __dept = MAX([Department])
VAR __product = MAX('Table6'[Product])
VAR __table1 = SELECTCOLUMNS(FILTER(ALL('Table5'),[Product] = __product),"__dept",[Department])
RETURN
IF(__dept IN __table1,1,BLANK())


Inverse Measure = 
VAR __dept = MAX([Department])
VAR __product = MAX('Table6'[Product])
VAR __table1 = SELECTCOLUMNS(FILTER(ALL('Table5'),[Product] = __product),"__dept",[Department])
RETURN
IF(__dept IN __table1,BLANK(),1)

See Table5, Table6 and Page 3 of attached.

 



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

I created an Inverse Slicer Measure once...

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Inverse-Aggregator/m-p/342266

 



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Greg,

 

Thanks for your response.
I had a look at this before, it calculates the SUM.

But, I want to display the contents of the table based on the filter.

Right, so create a disconnected table like this:

 

Table6 = ALL('Table5'[Product])

Use this for your slicer. Then, create these two measures and use them in your tables. 

 

Normal Measure = 
VAR __dept = MAX([Department])
VAR __product = MAX('Table6'[Product])
VAR __table1 = SELECTCOLUMNS(FILTER(ALL('Table5'),[Product] = __product),"__dept",[Department])
RETURN
IF(__dept IN __table1,1,BLANK())


Inverse Measure = 
VAR __dept = MAX([Department])
VAR __product = MAX('Table6'[Product])
VAR __table1 = SELECTCOLUMNS(FILTER(ALL('Table5'),[Product] = __product),"__dept",[Department])
RETURN
IF(__dept IN __table1,BLANK(),1)

See Table5, Table6 and Page 3 of attached.

 



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Greg,

 

It's working perfectly.

Thank you so much....

I think I'll submit this as a new Quick Measure!



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.