Forum Discussion

codyraptor's avatar
codyraptor
Icon for Resolver I rankResolver I
4 years ago
Solved

Count/sum without duplicate rows and define which row is accurate

This is probably super easy...just haven't dealt with it in DAX.  How do I go about getting the correct count/sum when I have duplicate dimensions and you need to specify which row to group by. For e...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi codyraptor ,

    Please refer to my pbix file to see if it helps you. I also use Direct Query mode.

    Create measures.

    Measure 1 = IF(SELECTEDVALUE('table$'[STATUS])="Open",1,0)
    Measure_2 =
    VAR maxx_ =
        MAXX ( ALLEXCEPT ( 'table$', 'table$'[ID] ), [Measure 1] )
    RETURN
        IF ( maxx_ = 1, "OPEN", SELECTEDVALUE ( 'table$'[STATUS] ) )
    

     

    Best Regards

    Community Support Team _ Polly

     

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