Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sharpers4567
Frequent Visitor

filtering between two tables

Hi guys,I am relatively new to powerbi and am struggling to implement this filter.
I have two tables, One with userID and one with their different qualifications, another table with different Jobs and the required qualification per job, my data looks something similar to below:

sharpers4567_0-1699038727969.png

I would like to match up the user to each Job they are qualified to do and hence be able to filter for each job to show the necessary users and qualifications.

I have tried a various approaches such as lookupvale, but as there can be multiple jobs available for different qualification i couldnt find a way around it. 
i tried to use concatenx:

Concatenx ( summarize(  filter( JOBS, JOBS[Requirement} = User[qualification] ) , JOBS[job] ) , JOBS[job] , ", ")

But this just gave me a list of the jobs that the qualifications Could get not what the user is qualified to get and unsure on how to filter the orignal table?

 

Hope this makes sense and Any help would be much appreciated and thank you in advance for any advice 🙂 

1 ACCEPTED SOLUTION
ERD
Community Champion
Community Champion

Hi @sharpers4567 , you can try this measure:

jobs = 
var t = 
    FILTER (
        GENERATE ( VALUES ( users[user] ), VALUES ( jobs[job] ) ),
            VAR current_user = CALCULATE ( MAX ( users[user] ) )
            VAR current_job = CALCULATE ( MAX ( jobs[job] ) )
            VAR qualifications = CALCULATETABLE ( VALUES ( users[qualification] ), users[user] = current_user )
            VAR requirements = CALCULATETABLE ( VALUES ( jobs[requirement] ), jobs[job] = current_job )
            VAR check = COUNTROWS ( EXCEPT ( requirements, qualifications ) )
            RETURN
                check = blank()
    )
RETURN
    CONCATENATEX( t, [job], ", " )

ERD_0-1699194233761.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @sharpers4567 

 

Has your problem been solved yet? If it is solved please accept the reply that offered you help as the solution. If it is not solved, please tell us what output you expect?

 

Best Regards

ERD
Community Champion
Community Champion

Hi @sharpers4567 , you can try this measure:

jobs = 
var t = 
    FILTER (
        GENERATE ( VALUES ( users[user] ), VALUES ( jobs[job] ) ),
            VAR current_user = CALCULATE ( MAX ( users[user] ) )
            VAR current_job = CALCULATE ( MAX ( jobs[job] ) )
            VAR qualifications = CALCULATETABLE ( VALUES ( users[qualification] ), users[user] = current_user )
            VAR requirements = CALCULATETABLE ( VALUES ( jobs[requirement] ), jobs[job] = current_job )
            VAR check = COUNTROWS ( EXCEPT ( requirements, qualifications ) )
            RETURN
                check = blank()
    )
RETURN
    CONCATENATEX( t, [job], ", " )

ERD_0-1699194233761.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

FreemanZ
Super User
Super User

hi @sharpers4567 ,

 

try to plot a table visual with table1[user] column and a measure like:

 

JobList = 
VAR _list = 
CALCULATETABLE(
    VALUES(Table2[job]),
    TREATAS(
        VALUES(Table2[Requirement]),
        Table1[Qualification]
    )
)
VAR _result = 
CONCATENATEX(
    _list,
    Table2[job],
    ", "
)
RETURN _result

 

 

plot a table visual with table2[requirement] column and a measure like:

UserList = 
VAR _list =
CALCULATETABLE(
    VALUES(Table1[user]),
    TREATAS(
        VALUES(Table1[Qualification]),
        Table2[Requirement]
    )
)
VAR _result =
CONCATENATEX(
    _list,
    Table1[user],
    ", "
)
RETURN _result

 

it worked like:

FreemanZ_0-1699068784193.png

 

 

Hi, Thank you for the solution, it looks like its heading in the right direction, However I am trying to show the users who match fully, for example for job 1 you need all x,y,z so only user 'a' would be qualified for that sepecific one, sorry for the confusion.

hi @sharpers4567 ,

 

try to plot a table visual with table2[job] column and a measure like:

QualUserList = 
VAR _reqlist = 
CONCATENATEX(
    VALUES(table2[Requirement]), 
    table2[Requirement], 
    ", "
)
VAR _table =
ADDCOLUMNS(
    VALUES(table1[user]),
    "QuaList",
    CONCATENATEX(
        CALCULATETABLE(VALUES(table1[qualification])),
        table1[qualification],
        ", "
    )
)
VAR _userlist =
CALCULATETABLE(
    VALUES(table1[user]),
    FILTER(
        _table,
        CONTAINSSTRING([QuaList], _reqlist)
    )
)
VAR _result =
CONCATENATEX(
    _userlist,
    table1[user],
    ", " 
)
RETURN _result

 

it worked like:

FreemanZ_0-1699241724645.png

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.