March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello! I'm trying to create a new column that checks if certain information has a match in another table, but I'm failing because my reference column matches more than once.
I have an "Inspections Table", like this:
Month | Inspection Leader | Inspected Location |
September | Albert | Front yard |
September | Bernard | Back yard |
October | Cromwell | Front yard |
October | Bernard | Back yard |
December | Cromwell | West yard |
And a "Planning Table", like this:
Month | Planned Location | Planned Leader |
September | Front yard | Albert |
September | Back yard | Cromwell |
October | West yard | Cromwell |
October | Front yard | Bernard |
December | West yard | Dennis |
December | Back yard | Bernard |
I'm trying to create two columns at the end of the "Inspections Table" like these:
Month | Inspection Leader | Inspected Location | Same Leader as planned for the month? | Same Location as planned for the month? |
September | Albert | Front yard | Yes | Yes |
September | Bernard | Back yard | No | Yes |
October | Cromwell | Front yard | Yes | Yes |
October | Bernard | Back yard | Yes | No |
December | Cromwell | West yard | No | No |
I tried going for a FILTER with an IF in DAX, but I can't get it right. I think I'm having trouble with the fact that months may occur more than once in the "Planning Table".
Thanks in advance!
Solved! Go to Solution.
I can get everything to match up except the December - West Yard I must be missing something. It is in both your inspections and planning table, just with a different leader so I get a Yes for [Same Location as planned for the month?]. Anyway, here are the calculated columns using LOOKUPVALUE.
Same Leader as planned for the month? =
IF (
Inspections[Inspection Leader]
= LOOKUPVALUE (
Planning[Planned Leader],
Planning[Month], Inspections[Month],
Planning[Planned Leader], Inspections[Inspection Leader]
),
"Yes",
"No"
)
Same Location as planned for the month? =
IF (
Inspections[Inspected Location]
= LOOKUPVALUE (
Planning[Planned Location],
Planning[Month], Inspections[Month],
Planning[Planned Location],Inspections[Inspected Location]
),
"Yes",
"No"
)
Thank you @jdbuchanan71 ! Now I see where I messed up. Marked your reply as solution.
I can get everything to match up except the December - West Yard I must be missing something. It is in both your inspections and planning table, just with a different leader so I get a Yes for [Same Location as planned for the month?]. Anyway, here are the calculated columns using LOOKUPVALUE.
Same Leader as planned for the month? =
IF (
Inspections[Inspection Leader]
= LOOKUPVALUE (
Planning[Planned Leader],
Planning[Month], Inspections[Month],
Planning[Planned Leader], Inspections[Inspection Leader]
),
"Yes",
"No"
)
Same Location as planned for the month? =
IF (
Inspections[Inspected Location]
= LOOKUPVALUE (
Planning[Planned Location],
Planning[Month], Inspections[Month],
Planning[Planned Location],Inspections[Inspected Location]
),
"Yes",
"No"
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |