Forum Discussion

Atanas_Atanasov's avatar
3 years ago
Solved

Counting People Based On Maximum Result

Dear All, I am really struggling with one calculation: Got the table from screenshot 1 where I have number of cases breakdown by person. In the rows I have a name and in the columns I have the BU: ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Atanas_Atanasov ,

     

    Here I create a sample to have a test.

    Measure:

    Engineer_Count = 
    VAR _STEP1 =
        SUMMARIZE (
            ALL ( 'Table' ),
            'Table'[Engineer Email],
            'Table'[BU Name],
            "Count", COUNT ( 'Table'[Engineer Email] )
        )
    VAR _STEP2 =
        FILTER (
            _STEP1,
            [Count]
                = MAXX (
                    FILTER ( _STEP1, [Engineer Email] = EARLIER ( [Engineer Email] ) ),
                    [Count]
                )
        )
    RETURN
        COUNTX (
            FILTER ( _STEP2, [BU Name] = MAX ( 'DimBU Name'[BU Name] ) ),
            [Engineer Email]
        ) + 0

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.