Forum Discussion

Laszlo's avatar
Laszlo
Microsoft Employee
6 years ago
Solved

Multiple filters on the same two columns

Hi all,

 

I am stuck a simple problem. 

 

Here is my example:

I have a table with event.title and registrant.email.

I added a columns based on the event.title column session names it tags them program1 or 2

Based on the email address I add a column which parse out the domain name. The individual user id will be removed eventually for privacy reasons. 

 

A user may attend a session multiple time and they can also attend sessions from either programs. 

 

event.titleregistrant.emailProgramdomain
session1[email protected]program1domain1
session1[email protected]program1domain1
session1[email protected]program1domain2
session1[email protected]program1domain5
session2[email protected]program1domain1
session2[email protected]program1domain1
session2[email protected]program1domain2
session2[email protected]program1domain3
session2[email protected]program1domain1
session2[email protected]program1domain5
session3[email protected]program2domain1
session3[email protected]program2domain1
session3[email protected]program2domain2
session3[email protected]program2domain3
session3[email protected]program2domain1
session3[email protected]program2domain4
session4[email protected]program2domain1
session4[email protected]program2domain1
session4[email protected]program2domain2
session4[email protected]program2domain3
session4[email protected]program2domain1
session4[email protected]program2domain4


What I am trying to achieve. 

Get a list of domains which attended program1 or 2 only

Get a list of domains which have attended sessions both from program1 and 2

I don't need counts of the domains which participated in both programs, but I need a list of domains rather. 

 

From the example above domain5 only attended program1 sessions while domain1-4 have have attended sessions from both progams. 

 

What would be a good approach to solve this problem? 

 

Thanks!

 

  • Hi Laszlo 

     

    I see the next solution.

    First add new calculated table

    Table 2 = DISTINCT(SELECTCOLUMNS('Table';"Domain";'Table'[domain];"Program";'Table'[program]))

    Next add measure to Table 2 like this

    Measure = calculate(DISTINCTCOUNTNOBLANK('Table 2'[Program]);ALLEXCEPT('Table 2';'Table 2'[Domain]))

    Then you can create visuals for example

    So, if Measure = 2, this domain is including both program, if measure=1 - the only.

     

    P.S. in your dataset example i see not only domain5, but domain4 also has attented session from the only program2

  • az38's avatar
    az38
    6 years ago

    hi Laszlo 

    exactly!

    but if to be more correct - new table contains distinct pair domain-program: we are clearing origin table from duplicate pairs. If in your datasource such duplicates are impossible - distincttable is not neccessary step

4 Replies