Forum Discussion

Wedding55's avatar
Wedding55
Helper II
3 years ago
Solved

Groupby with different calculations

Hello all,   i have a table with following measures:   digital: count of digital products per customer offline: count of offline products per customer total: count of total products per custome...
  • v-yanjiang-msft's avatar
    3 years ago

    Hi Wedding55 ,

    According to your description, I create a sample.

    And create measures like yours, finally get the correct result.

    May I know before you put "type" in the visual, is there a single row or two rows of customer 100204? If there're two rows, I think it's not the problem of "type".

    Or you can try to modify the formula like this:

    digital =
    COUNTROWS (
        FILTER (
            ALL ( 'Cases' ),
            'Cases'[customer] = MAX ( 'Cases'[customer] )
                && 'Cases'[organisation] = "Org1"
                && 'Cases'[tc] = 1
        )
    )
    
    total =
    COUNTROWS (
        FILTER (
            ALL ( 'Cases' ),
            'Cases'[customer] = MAX ( 'Cases'[customer] )
                && 'Cases'[tc] = 1
        )
    )
    

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

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