Forum Discussion
gizattos
6 years agoRegular Visitor
Sum by weeknumber
Hi guys, I'm trying to create a column based on last week value with DAX, I already create weeknumber column. I tryed this code : lastweek value = CALCULATE(SUMX(Tabela,Tabela[Insight]),FILTER(A...
- Anonymous6 years ago
Hi gizattos ,
You can use EARLIER() function
Column = CALCULATE(SUM('Table'[insight]),FILTER('Table','Table'[weeknumber]=EARLIER('Table'[weeknumber])-1))Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ryan_mayu
6 years agoSuper User
Please try the DAX below to see if this works for you
lastweek value =
VAR d = max(tabela[weeknumber])
RETURN CALCULATE(SUMX(Tabela,Tabela[Insight]),FILTER(ALL(Tabela),Tabela[weeknumber]=d-1))
gizattos
6 years agoRegular Visitor
didn't work, now i have the sum of a specific week repeated for all rows.