Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX Help

I do have a requriment  and need help on DAX. There is a report which pulls data from project details and Invoice tables. When user selects the project either single select or multi selct. The data ...
  • v-luwang-msft's avatar
    4 years ago

    Hi Anonymous ,

    Try measure like below :

    test1 = 
    CALCULATE (
        MAX ( 'Project Details'[Start date] ),
        FILTER (
            ALLSELECTED ( 'Project Details' ),
            MAX ( 'Invoice Table'[Project Name] ) = 'Project Details'[Project Name]
        )
    )
    test2 = 
    CALCULATE (
        SUM ( 'Invoice Table'[Rev] ),
        FILTER (
            ALLSELECTED ( 'Project Details' ),
            MAX ( 'Invoice Table'[Project Name] ) = 'Project Details'[Project Name]
                && MAX ( 'Invoice Table'[Invoice Date] ) >= [test1]
        )
    )
    test3 = SUMX('Invoice Table',[test2])

    Final get :

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien