Forum Discussion

dsj8wksnnckk's avatar
dsj8wksnnckk
Icon for Resolver I rankResolver I
1 year ago
Solved

Mapping columns from two tables

Hi, I need help with DAX. I have these 2 tables Table1 Opportunity ID Opportunity Stage Role Skill Seniority Opportunity A Committed Software Developer .NET Senior Opportunity A...
  • dsj8wksnnckk's avatar
    dsj8wksnnckk
    1 year ago

    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"
    )