Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Lookup value in Matrix

Hi everyone,   I have a problem to do calculation by using Matrix.  Column: Reporting Date (i.e. March 2, 2020 -- 2) Row: All rows are calculated from Tables Table 1: Claim Info. - One cla...
  • v-gizhi-msft's avatar
    6 years ago

    Hi,

     

    According to your description, i create a sample to test:

    Then please try this measure:

    Measure = 
    VAR CountOfPerDay =
        CALCULATE (
            COUNT ( 'Table 1'[Reporting Date] ),
            FILTER (
                ALLSELECTED ( 'Table 1' ),
                'Table 1'[Examiner name] IN FILTERS ( 'Table 1'[Examiner name] )
                    && 'Table 1'[Reporting date] IN FILTERS ( 'Table 1'[Reporting date] )
            )
        )
    RETURN
        CALCULATE (
            SUM ( 'Table 2'[Target] ),
            FILTER (
                ALLSELECTED ( 'Table 2' ),
                'Table 2'[Examiner] IN FILTERS ( 'Table 1'[Examiner name] )
                    && 'Table 2'[Reporting Date] = MAX ( 'Table 1'[Reporting date] )
            )
        ) / CountOfPerDay

    The result shows the assigned target value for each line per day:


    Here is my test pbix file:

    pbix 

    Hope this helps.

     

    Best Regards,

    Giotto Zhi