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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
datavis
Resolver I
Resolver I

Matching Data in two tables

In Power BI desktop I have two sets of data, both of which have a column called Employee ID. I need to create a column called Compliance using the Employee IDs that match between the two data sets.

 

If Training Compliance Employee ID matches Active Positions Employee ID then I need it to return Non-Compliant in my new Compliance column.

 

Hope that makes sense. Any help will be appreciated.

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hi@ datavis

You can use ISBLANK() function like below:

Column = IF(ISBLANK(LOOKUPVALUE(Table7[EmplID],Table7[EmplID],Table6[EmplID])) ,  "Compliant",
    "Non-Compliant"
)

 

Result:

Basic data

1.png2.png

 

Best Regards,

Lin

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

View solution in original post

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

Hi@ datavis

You can use ISBLANK() function like below:

Column = IF(ISBLANK(LOOKUPVALUE(Table7[EmplID],Table7[EmplID],Table6[EmplID])) ,  "Compliant",
    "Non-Compliant"
)

 

Result:

Basic data

1.png2.png

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I want to compare two columns in two different tables by text. After that I want to count them.

  1. g Equipment Table Having Status Column with value “Not Submitted” & Same Values with Same Column Name in MASTER LIST Table. So I want total “Not Submiited” from Both table. Attached alos is PBX file
  2.  
  3. O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
    O&MNot Submitted
  4. DELIVERABLESStatusTESTING
    WIR
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS
    Mechanical EquipmentNot SubmittedNS

Sorry, when I say Vacant, I don't mean Blank. The word Vacant is in the Name column when the position is vacant so ISBLANK won't work.

 

Column = IF(ISBLANK(LOOKUPVALUE(Table7[EmplID],Table7[EmplID],Table6[EmplID])) ,  "Compliant",
    "Non-Compliant"
)

 

So, if EmplID column in the delinquent table matches the the EmplID column in the Active Positions table then Non-Compliant but if Name is Vacant then Vacant.

That works! Thank you!

Anonymous
Not applicable

Hello @datavis

 

You can do this using the Edit queries or DAX, but you need to do a workaround, unfortunately you can't do it directly.

 

  1. Using Edit queries theres an option called Merge Queries, this option has the same behavior of "lookupv", what you need to do using this option and bring any column no matter the content, for those where there was coincidence it will bring a value and for the others the value will be "null", after this you need to create a "Conditional column", and with this option you select the column that you bring with the Merge option and ask if the value is "null". Once you are in this option you will become familiar with what you have to do.
  2. Using DAX is basically the same thing but you need to do it on a "Calculate column", using any of the functions "RELATED" or "LOOKUPVALUE"

I hope this will help you.

 

Good luck.

Thank you HarrisonCbe,

I used lookupvalue to get compliant or non-compliant.

Training Compliance =
IF (
    LOOKUPVALUE ('HHS-DSHS-ActivePositions'[EmplID],'HHS-DSHS-ActivePositions'[EmplID],'DelinquentTraining'[Emplid])
        ,
    "Non-Compliant",
    "Compliant"
)

If any names in 'HHS-DSHS-ActivePositions'[Name] is vacant, then 'Delinquent Training'[Training Compliance} column will show Compliant.

Not sure how to write that. Help appreciated.

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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