Forum Discussion
tarolz132q
4 years agoNew Member
Avg Balance DAX
Hi Folks, I would like to measure the Avg coin balance for each day. The challenge is to calculate only the newst coin balance for each date by USER_ID. if you notice, AF4FF96..... is shown twice! ...
- 4 years ago
Ashish_Mathur
4 years agoSuper User
Hi,
Please explain how you arrived at the ansers of 98 and 156.
tarolz132q
4 years agoNew Member
please see my new reply
- lbendlin4 years agoSuper User
Avg = var d = SELECTEDVALUE('Table'[DATE]) var a = calculatetable(SUMMARIZE('Table','Table'[USER_ID],"md",max('Table'[DATE])),'Table'[DATE]<=d) var b = ADDCOLUMNS(a,"mb",var md=[md] return CALCULATE(sum('Table'[COIN_BALANCE]),'Table'[DATE]=md)) return divide(sumx(b,[mb]),countrows(b),0)