Forum Discussion

Reshma_Doshi's avatar
Reshma_Doshi
Regular Visitor
3 years ago
Solved

Need help with Dax

I have data as shown in the Image - which time spent in seconds on an App on various days.  All columns are defined below.    Col F is derived using Col B and Col E is derived using Col C. Values ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Reshma_Doshi 

    You can create a measure as follows

    Measure = var a=SUMMARIZE(ALLSELECTED('Table'),[User id],[Month],[Distinct Date Count],[Sum of Duration in Secs],"Divide",DIVIDE([Sum of Duration in Secs],[Distinct Date Count])/CALCULATE(DISTINCTCOUNT('Table'[User id]),ALLSELECTED('Table')))
    return SUMX(FILTER(a,[User id] in VALUES('Table'[User id])&&[Month] in VALUES('Table'[Month])),[Divide])/60

    Output

     

    Best Regards!

    Yolo Zhu

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