Forum Discussion

jwelch176's avatar
jwelch176
Frequent Visitor
5 years ago
Solved

Filter to show mutually exclusive results

New Power BI user here.  I receive a new member roster weekly.  I need to compare the old roster to the new roster and send information to any incoming or outgoing members.  I want to see just the rows of incoming and outgoing members. 

 

I took data from two data sources:  01012021 Roster and 01082021 Roster. I selected 01012021 Roster and then Append Queries as New then 01082020 Roster to get all the data into one table. 

IDlast namefirst nameFile Name
AAAdamAmarillo01012021 Roster
BBBobbyBrown01012021 Roster
CCCharlesChartruese01012021 Roster
AAAdamAmarillo01082021 Roster
CCCharlesChartruese01082021 Roster
DDDavidDenim01082021 Roster
EEEdwardEcru01082021 Roster

How do I select/filter just the incoming and outgoing members while ignoring the members that have no status change?  This would be an exclusive OR function.  My research brought up the UNIQUE formula in Excel, but I could not get it to work in Power BI.  The same with IF(Countif)[ID]=1,"Send info.

 

Am I even on the right track?  Any help would be appreciated.

  • The Power BI DAX equivalent is the EXCEPT  function that allows you to compare two tables of the same structure.

     

    Create two table variables, one for each filename, with the IDs of the users.

     

    EXCEPT(new,old) - all users that are new on the roster.

    EXCEPT(old,new) - all users that were dropped from the roster.

  • Hi jwelch176 ,

    Besides using EXCEPT() in DAX, you can also try to use merge tables to get the mutually exclusive results:

    Remove the last column to get the result table:

    Attached a sample file in the below, hopes to help you.

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • The Power BI DAX equivalent is the EXCEPT  function that allows you to compare two tables of the same structure.

     

    Create two table variables, one for each filename, with the IDs of the users.

     

    EXCEPT(new,old) - all users that are new on the roster.

    EXCEPT(old,new) - all users that were dropped from the roster.

  • v-yingjl's avatar
    v-yingjl
    Icon for Community Support rankCommunity Support

    Hi jwelch176 ,

    Besides using EXCEPT() in DAX, you can also try to use merge tables to get the mutually exclusive results:

    Remove the last column to get the result table:

    Attached a sample file in the below, hopes to help you.

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.