Forum Discussion
Sum of Certain Rows
- 6 years ago
Hi Anonymous ,
Your DAX expression does indeed not lead to the expected results. The solution of Tahreem24 is also not working, as you cannot use EARLIER() in a measure. However, you can use it in a Calculated Column.
Try the following DAX in a calculated column:
Total = VAR currentRowDate = 'Table'[Date] VAR currentPerson = 'Table'[Person] RETURN CALCULATE(SUM('Table'[Usage]), FILTER(Table, 'Table'[Date] = currentRowDate && 'Table'[Person] = currentPerson))If you want to understand what this does, let me know! I wrote it out so it is the most readable for you 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Kudo's are welcome 🙂
- 6 years agoCreate a measure like below :
Total = CALCULATE (SUM(Table[Usage]), Filter(Table, Table[Datecolumn]=Earlier(Table[Datecolumn ] )&&Table [Person] =Earlier (Table[Person])))
Please replace, with & &
Hi Anonymous ,
Your DAX expression does indeed not lead to the expected results. The solution of Tahreem24 is also not working, as you cannot use EARLIER() in a measure. However, you can use it in a Calculated Column.
Try the following DAX in a calculated column:
Total =
VAR currentRowDate = 'Table'[Date]
VAR currentPerson = 'Table'[Person]
RETURN
CALCULATE(SUM('Table'[Usage]), FILTER(Table, 'Table'[Date] = currentRowDate && 'Table'[Person] = currentPerson))If you want to understand what this does, let me know! I wrote it out so it is the most readable for you 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Kudo's are welcome 🙂