Forum Discussion

TCatron18's avatar
TCatron18
Helper II
1 year ago
Solved

Pull Column from Unrelated Table

I have two tables that don't have a direct connection, but they are both connected a table that has a full list of all Users. I'm needing to pull a column from one of the tables into the other based ...
  • SamsonTruong's avatar
    1 year ago

    Hi TCatron18 ,

    I was able to create a calculated column for Term Date in the Start Table using the following DAX:

    Term Date = 
    VAR CurrentUser = [User]
    VAR CurrentStartDate = [Date]
    RETURN
        CALCULATE(
            MIN(Term[Date]),
            FILTER(
                Term,
                NOT ISBLANK(Term[Date]) &&
                Term[Date] >= CurrentStartDate
            ),
            TREATAS({CurrentUser}, Term[User])
        )


    Using this calculated column with your test data, I get the following output:

    If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

    Thanks,

    Samson

  • techies's avatar
    1 year ago

    Hi TCatron18 please try this

     

    MatchedTermDate =
    CALCULATE(
        MIN('term table'[Date]),
        FILTER(
            'term table',
            'term table'[User] = 'start table'[User] &&
            NOT(ISBLANK('term table'[Date])) &&
            'term table'[Date] >= 'start table'[Date]
        )
    )