Forum Discussion
Anonymous_n
1 year agoFrequent Visitor
Power BI - Filter Specific VIP + Show Non-VIP Together in Visuals
Hi everyone, I’m working on a Power BI dashboard where I need to handle filtering logic for two types of employees: VIP and Non-VIP. Here's my current setup: Select VIP: A slicer filter that lets ...
danextian
1 year agoSuper User
Hi Anonymous_n
You wil neeed two disconnected tables - one containing just the VIPs and the other containing all groups. You can create them using DAX or M. Sample DAX calc tables
ALLEmployees =
SUMMARIZE ( VIPData, VIPData[Employee_ID], VIPData[NAME], VIPData[VIP GROUP] )
VIPEmployees =
SUMMARIZE (
FILTER ( VIPData, VIPData[VIP GROUP] = "VIP" ),
VIPData[Employee_ID],
VIPData[NAME]
)
And then a measure to return based on slicer selections
VIP Filter =
VAR __LOOKUPTABLE =
DISTINCT (
UNION (
VALUES ( VIPEmployees[Employee_ID] ),
SUMMARIZE (
FILTER ( ALLEmployees, ALLEmployees[VIP GROUP] = "Non-VIP" ),
ALLEmployees[Employee_ID]
)
)
)
RETURN
CALCULATE (
COUNTROWS ( VIPData ),
KEEPFILTERS ( TREATAS ( __LOOKUPTABLE, VIPData[Employee_ID] ) )
)
Please see the attached pbix for the details.
- Anonymous_n1 year agoFrequent Visitor
Thank you so much! This is almost exactly what I need. There’s just one thing missing—if no VIP selection is made, I want VIPs to be completely excluded from the visuals. Currently, if nothing is selected, it shows all VIPs.
So, if I want to add another slicer that have 2 options: allows user to Include or Exclude VIPs:
- When Include VIP is selected, the slicer should show VIP names for selection.
- When Exclude VIP is selected, VIPs should not appear at all (no names to select).
Is this possible? Thank you again for your guidance—you’re amazing! 😊