Forum Discussion

SanderTK's avatar
SanderTK
Advocate II
4 years ago
Solved

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...
  • Jihwan_Kim's avatar
    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] ) )