Forum Discussion
SanderTK
4 years agoAdvocate II
Filter based on related filtered data
I'm stuck on what I believe is to be a relatively easy subject but for some reason I can't seem to find the right way to get to my desired result: I've got a fact table of ticket sales and a dimen...
- 4 years ago
Hi,
I suggest having a disconnected production slicer table like the attached sample file.
Please check the below picture and the attached pbix file.
Count of person measure: = VAR list_bookerIDs = CALCULATETABLE ( VALUES ( Ticketsales[bookerID] ), FILTER ( ALL ( Ticketsales ), Ticketsales[productionID] = SELECTEDVALUE ( 'Production Slicer'[productionID] ) ) ) VAR list_lookerIDs_product = FILTER ( Ticketsales, Ticketsales[bookerID] IN list_bookerIDs && Ticketsales[productionID] <> SELECTEDVALUE ( 'Production Slicer'[productionID] ) ) RETURN COUNTROWS ( SUMMARIZE ( list_lookerIDs_product, Ticketsales[bookerID] ) )
Jihwan_Kim
4 years agoSuper User
Hi,
I suggest having a disconnected production slicer table like the attached sample file.
Please check the below picture and the attached pbix file.
Count of person measure: =
VAR list_bookerIDs =
CALCULATETABLE (
VALUES ( Ticketsales[bookerID] ),
FILTER (
ALL ( Ticketsales ),
Ticketsales[productionID] = SELECTEDVALUE ( 'Production Slicer'[productionID] )
)
)
VAR list_lookerIDs_product =
FILTER (
Ticketsales,
Ticketsales[bookerID]
IN list_bookerIDs
&& Ticketsales[productionID] <> SELECTEDVALUE ( 'Production Slicer'[productionID] )
)
RETURN
COUNTROWS ( SUMMARIZE ( list_lookerIDs_product, Ticketsales[bookerID] ) )
SanderTK
4 years agoAdvocate II
That is a beautiful solution that I wouldn't ever have thought of.
I will apply it to my datamodel tomorrow and when I've got it working, I'll mark your answer as the solution.
Thank you so much!