Forum Discussion

PBI_AMS's avatar
PBI_AMS
Helper I
1 year ago
Solved

Slicing a visual while excluding the selected value from the visual

I am analyzing subscriber data.  I have 100k plus subscribers who have opted into up to 10 topics. What I want to be able to see is: If you are a subscriber to topic C, what OTHER topics are you also...
  • v-sshirivolu's avatar
    v-sshirivolu
    1 year ago

    Hi PBI_AMS ,

    Thanks for reaching out to the Microsoft fabric community forum.

     

    Try this DAX measure :

     

    ExcludedTopics =
    VAR SelectedTopics =
        VALUES(ContactFilterTable[SelectedTopic])

    VAR HasSelection =
        COUNTROWS(SelectedTopics) > 0

    VAR SelectedContacts =
        CALCULATETABLE(
            VALUES(ContactOutputTable[ContactGUID]),
            ContactOutputTable[Topic] IN SelectedTopics
        )
    RETURN
    IF(
        HasSelection,
        CALCULATE(
            COUNTROWS(ContactOutputTable),
            FILTER(
                ContactOutputTable,
                ContactOutputTable[ContactGUID] IN SelectedContacts &&
                NOT(ContactOutputTable[Topic] IN SelectedTopics)
            )
        ),
        0
    )


    Find the below Attached .pbix file for your reference.

    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

    Best Regards,
    Sreeteja.
    Community Support Team