Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Aggregation/Filtering obstacles and how to overcome it

Hello Dear Community!   I have some data on online games. Per log-in session the customers can play for example only Tennis, or Tennis and Football or 10 different sports if they feel like it. Per ...
  • v-xiaotang's avatar
    v-xiaotang
    5 years ago

    Anonymous 

    🤣🤣🤣

    OKay, then you need to add a column

    distCountCol = CALCULATE(DISTINCTCOUNT(Table1[game_name_en]),ALLEXCEPT(Table1,Table1[login_session_number]))

    then, create the measure

    distCount2 = 
    IF( CALCULATE(MAX(Table1[distCountCol]),ALLEXCEPT(Table1,Table1[customer_number]))<>1,3,1)
    MeasureTest2 = 
    var _selgamename=SELECTEDVALUE(Table2[game_name_en])
    var _distCount=CALCULATE(DISTINCTCOUNT(Table1[game_name_en]),ALLEXCEPT(Table1,Table1[login_session_number]))
    var _min=CALCULATE(MIN(Table1[login_date]),FILTER(ALL(Table1),Table1[customer_number]=MIN(Table1[customer_number])&&Table1[game_name_en]=_selgamename&&[distCount2]=1))
    return IF(MIN(Table1[login_date])=_min&&MIN(Table1[game_name_en])=_selgamename,1,0)

    then put the MeasureTest2 into Filters on this visual

    result

     

     

    Best Regards,

    Community Support Team _Tang

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