Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Comparing dates to related table

Hey,   This is driving me nuts, and I would be able to do this in both SQL and Excel in minutes. I think I just dont understand the basics of DAX :-).   I have one parent table called Contacts an...
  • v-jiascu-msft's avatar
    v-jiascu-msft
    7 years ago

    Hi Anonymous ,

     

    You are right. It's a Row context which can't be propagated. Please try this one below.

     

    FirstCallInterval =
    VAR firstCallDate =
        CALCULATE (
            MIN ( 'CallLog'[CallTime] ),
            FILTER (
                'CallLog',
                'CallLog'[CallTime] >= 'Contacts'[AssignedToSalesPerson]
                    && CallLog[ContactID] = Contacts[ID]
            )
        )
    RETURN
        DATEDIFF ( [AssignedToSalesPerson], firstCallDate, HOUR )
    

     

     

    Best Regards,