Forum Discussion

DanS446's avatar
DanS446
Helper I
2 years ago
Solved

Filter out data from one table but keep other data

Greetings, i have 2 tables with a relation for their id number called "NUP"   A calculated column to check if the smaller table IDs matches the big table IDs NUP match = IF(Mail[NUP] IN SEL...
  • DanS446's avatar
    2 years ago

    I solved it follwing user jaideepnema solution on another post as an example:

     

    - Created a new table with Assigned column as a class table, so cointains all names on Assign plus a blank (" ").

    - Use that table as a slicer

    - Copy over the Assigned values to main table with a calculated column:

    Assigned = LOOKUPVALUE('NUP company'[Assigned],'NUP company'[NUP], Mail[NUP] )

    so now we have: all IDs>company IDs>Assigned IDs on the same table (else you have to actually put Assigned on the visual table so the filter works)

     

    - Create a measure to filter the visual table:

    Filter = IF(SELECTEDVALUE('Mail'[Assigned])=BLANK() || SELECTEDVALUE(Class[Assigned])=SELECTEDVALUE(Mail[Assigned]) || SELECTEDVALUE(Class[Assigned])=BLANK() ,1,0)

    - Use measure as a filter for main visual table (is = 1)

     

    This shows all data when no selection is made on Assigned slicer, but when you select an user, it filters out only the company IDs that have other users assigned, keeping the rest of the data. The only problem is that selecting more than one user results in all data being showed, not a problem in my application, will only select one at a time.

     

    Another related measure:

    Not total = CALCULATE(COUNTROWS(Mail), FILTER(Mail,[Filter]))+0

    I had a "total notifications" measure, making it calculate using filter for the main table and the measure works on counting the same data as the measure filter does, before it will ignore it since it usually works on sliced data and not a measure filter.