Forum Discussion
Anonymous
3 years agoNot applicable
Convert Tableau function WINDOW_SUM into DAX
Hello,
I would like to convert the below Tableau expression into DAX:
WINDOW_SUM(sum([values]), -DATEDIFF('day',DATE('1/4/'+str(year(DATEADD('month',-3,attr([Date]))))),attr([Date])),0)
6 Replies
- Greg_DecklerCommunity Champion
Anonymous What does WINDOW_SUM do?
- AnonymousNot applicable
Greg_Deckler , here is a link and extract:
https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm - AnonymousNot applicable
Greg_Deckler ,
As I understand this formula, it starts summing up values on 1 April and restarts every year on the same date.
The first value is of 1 April, the second value is of 2 April + 3 April, the third value is of 3 April +4 April+5 April and so on.- Greg_DecklerCommunity Champion
Anonymous Maybe:
Cumulative April 1 = VAR __Date = MAX('Table'[Date]) VAR __Year = IF(MONTH(__Date) < 4, YEAR(__Date) - 1 , YEAR(__Date)) VAR __Table = FILTER(ALL('Table'), [Date] <= __Date && [Date] >= DATE(__Year, 4, 1)) VAR __Result = SUMX(__Table, [Values]) RETURN __Result- AnonymousNot applicable
Greg_Deckler The formula works as a cumulative total. There window element is not there.