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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
dsj8wksnnckk
Resolver I
Resolver I

Mapping columns from two tables

Hi, I need help with DAX.

I have these 2 tables

Table1

Opportunity IDOpportunity StageRoleSkillSeniority
Opportunity ACommittedSoftware Developer.NETSenior
Opportunity ACommittedSoftware DeveloperJavaJunior
Opportunity ACommittedProduct DesignerDesignJunior
Opportunity BProposedData ScientistPythonMedior
Opportunity BProposedFrontend DeveloperReactSenior
Opportunity BProposedBusiness AnalystRequirementsJunior
Opportunity CIn NegotiationBackend DeveloperNode.jsMedior
Opportunity CIn NegotiationUI/UX DesignerFigmaSenior
Opportunity CIn NegotiationScrum MasterAgileJunior
Opportunity DCommittedSoftware DeveloperPHPMedior
Opportunity DCommittedData EngineerSparkSenior
Opportunity DCommittedDevOps EngineerDockerMedior
Opportunity EProposedCybersecurity AnalystNetwork SecurityJunior
Opportunity EProposedCloud EngineerAWSSenior
Opportunity FCommittedFull Stack DeveloperMEANMedior
Opportunity FCommittedQA EngineerSeleniumSenior
Opportunity GIn NegotiationSystem AdministratorLinuxJunior
Opportunity GIn NegotiationProduct ManagerRoadmapsSenior
Opportunity GIn NegotiationMachine Learning EngineerTensorFlowMedior
Opportunity HCommittedAI EngineerNLPJunior
Opportunity HProposedCloud ArchitectAzureSenior
Opportunity HProposedDatabase AdministratorMySQLMedior
Opportunity IIn NegotiationSoftware EngineerC++Junior
Opportunity IIn NegotiationMarketing SpecialistSEOMedior
Opportunity JProposedMobile DeveloperiOSSenior
Opportunity KCommittedData AnalystSQLMedior
Opportunity KCommittedFrontend DeveloperVue.jsSenior


Table2

Resource NameRoleSkillSeniorityCommercial StatusBench StartBench End
RickSoftware Developer.NETSeniorIn Delivery  
MortySoftware DeveloperJavaMediorOn Bench01.01.202515.04.2025
DeanProduct DesignerDesignMediorOn Bench01.01.202501.03.2025
SamSDMProject ManagementN/AIn Delivery  
LuciferSoftware Developer.NETSeniorOn Bench01.01.202501.07.2025
JaneData ScientistPythonSeniorIn Delivery  
AliceData AnalystSQLJuniorOn Bench15.02.202501.05.2025
MikeFrontend DeveloperReactSeniorOn Bench10.01.202530.03.2025
KateUI/UX DesignerFigmaMediorOn Bench05.02.202505.04.2025
GeorgeCloud EngineerAWSSeniorOn Bench01.03.202501.06.2025
NoahSystem AdministratorLinuxJuniorOn Bench20.02.202515.04.2025
SophiaData EngineerSparkMediorOn Bench15.01.202501.03.2025
LiamCybersecurity AnalystNetwork SecurityJuniorOn Bench10.03.202530.05.2025
EllaFull Stack DeveloperMEANMediorOn Bench01.02.202515.05.2025
EthanAI EngineerNLPMediorOn Bench05.04.202510.06.2025
NatalieQA LeadManual TestingSeniorOn Bench15.01.202501.03.2025
LiamFrontend DeveloperVue.jsJuniorOn Bench01.03.202501.07.2025
ZachSoftware EngineerC++SeniorOn Bench20.02.202501.04.2025
IslaMobile DeveloperiOSMediorOn Bench15.03.202501.07.2025
MiaProduct ManagerRoadmapsRoadmapsSeniorIn Delivery 
EllaFull Stack DeveloperMEANMEANMediorOn Bench01.02.2025
AvaML EngineerTensorFlowTensorFlowSeniorIn Delivery 
EthanAI EngineerNLPMySQLMediorOn Bench05.04.2025
JacksonCloud ArchitectAzureAzureSeniorIn Delivery 
NatalieQA LeadManual TestingManual TestingSeniorOn Bench15.01.2025
LiamFrontend DeveloperVue.jsVue.jsJuniorOn Bench01.03.2025
HannahDatabase AdministratorMySQLiOSMediorIn Delivery 
ZachSoftware EngineerC++C++SeniorOn Bench20.02.2025
IslaMobile DeveloperiOSiOSMediorOn Bench15.03.2025
GraceMarketing SpecialistSEOSEOJuniorIn Delivery 
   SEO   



I need to create a calculated column in Table1:

For every Commited Opportunity find a match in Role and Skill from Table2 but only Resource that is on Bench

Return the Resource name as a result in the new calculated column (if possible Bench start and end date as well)

Thanks in advance

1 ACCEPTED SOLUTION

Hi,

thanks for your help. I have adjusted the formula and got the result I needed

Assigned Resource =
VAR CurrentOpportunity = Table1[Opportunity ID]
VAR CurrentRole = Table1[Role]
VAR CurrentSkill = Table1[Skill]
VAR CurrentStage = Table1[Opportunity Stage]

RETURN
IF(
CurrentStage = "Committed",
VAR MatchingResource =
FILTER(
Table2,
Table2[Role] = CurrentRole &&
Table2[Skill] = CurrentSkill &&
Table2[Commercial Status] = "On Bench"
)
VAR ResourceName = MAXX(MatchingResource, Table2[Resource Name])
VAR BenchStart = MAXX(MatchingResource, Table2[Bench Start])
VAR BenchEnd = MAXX(MatchingResource, Table2[Bench End])

RETURN
IF(NOT ISBLANK(ResourceName),
ResourceName & " (Bench Start: " & FORMAT(BenchStart, "dd.MM.yyyy") &
", Bench End: " & FORMAT(BenchEnd, "dd.MM.yyyy") & ")",
"No Match"
),
"Not Committed"
)

View solution in original post

2 REPLIES 2
123abc
Community Champion
Community Champion

You can create a calculated column in Table1 that checks for matching roles and skills in Table2 for committed opportunities....PLZ TRY BELOW MEASURE.

 

Assigned Resource =
VAR CurrentOpportunity = Table1[Opportunity ID]
VAR CurrentRole = Table1[Role]
VAR CurrentSkill = Table1[Skill]
VAR CurrentStage = Table1[Opportunity Stage]

RETURN
IF(
CurrentStage = "Committed",
VAR MatchingResource =
FILTER(
Table2,
Table2[Role] = CurrentRole &&
Table2[Skill] = CurrentSkill &&
Table2[Commercial Status] = "On Bench"
)
VAR ResourceName = SELECTEDVALUE(MatchingResource[Resource Name])
VAR BenchStart = SELECTEDVALUE(MatchingResource[Bench Start])
VAR BenchEnd = SELECTEDVALUE(MatchingResource[Bench End])

RETURN
IF(NOT ISBLANK(ResourceName),
ResourceName & " (Bench Start: " & FORMAT(BenchStart, "dd.MM.yyyy") &
", Bench End: " & FORMAT(BenchEnd, "dd.MM.yyyy") & ")",
"No Match"
),
"Not Committed"
)

 

RESULT:

  • If a match is found, the result shows the Resource Name and their bench start and end dates.
  • If there’s no match, it returns "No Match".
  • If the opportunity stage is not "Committed," it returns "Not Committed."

This formula will give you a calculated column in Table1 with the assigned resource's name, bench start, and end dates for each committed opportunity.

Hi,

thanks for your help. I have adjusted the formula and got the result I needed

Assigned Resource =
VAR CurrentOpportunity = Table1[Opportunity ID]
VAR CurrentRole = Table1[Role]
VAR CurrentSkill = Table1[Skill]
VAR CurrentStage = Table1[Opportunity Stage]

RETURN
IF(
CurrentStage = "Committed",
VAR MatchingResource =
FILTER(
Table2,
Table2[Role] = CurrentRole &&
Table2[Skill] = CurrentSkill &&
Table2[Commercial Status] = "On Bench"
)
VAR ResourceName = MAXX(MatchingResource, Table2[Resource Name])
VAR BenchStart = MAXX(MatchingResource, Table2[Bench Start])
VAR BenchEnd = MAXX(MatchingResource, Table2[Bench End])

RETURN
IF(NOT ISBLANK(ResourceName),
ResourceName & " (Bench Start: " & FORMAT(BenchStart, "dd.MM.yyyy") &
", Bench End: " & FORMAT(BenchEnd, "dd.MM.yyyy") & ")",
"No Match"
),
"Not Committed"
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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