Forum Discussion
liamr0639
3 years agoNew Member
Return SUM for newest value by unique ID
Hi all, I'm pretty new to PowerBi but I have got good familarity. I want to return a SUM value (so I can put in a card visual) of a SUM of values only by unique IDs and their latest date of v...
liamr0639
3 years agoNew Member
Hi, many thanks for this!
Do you know if it's possible to do by day also? As I want the slider to be in days between a period.
Many thanks
- ValtteriN3 years ago
Community Champion
Sure, something like this might work depending on the filters you use:
Latest or sum =var _latest = CALCULATE(Month(MAX('Table (11)'[DateTime])),ALL('Table (11)'))var _latestS = MAX('Calendar'[Month])returnIF(COUNTROWS(FILTER(ALL('Table (11)'),MONTH('Table (11)'[DateTime])=_latestS))=0,CALCULATE(SUM('Table (11)'[Amount]),ALL('Table (11)'[DateTime]),MONTH('Table (11)'[DateTime]))=_latest,SUM('Table (11)'[Amount]))