Forum Discussion
sabeensp
Helper IV
7 years agoLast 12 Month Extract
Hello, I'm new to PBI. I have a table with many columns including Year and Month. I need to SUMMARIZE table into another table with only last 12 months data. We do not have DATE Dimmension in...
- 7 years ago
Perhaps something like:
Table 1 = VAR __year = MAX('Table'[Year]) VAR __yearPrev = __year - 1 VAR __month = MAXX(FILTER('Table',[Year]=__year),[Month]) VAR __table = FILTER('Table',[Year] = __year || ([Year] = __yearPrev && [Month] > __month)) RETURN SUMMARIZE(__table,[Year],[Month],"My Column",SUM([Value]))Also, I feel that this link might come in handy for you:
Greg_Deckler
Community Champion
7 years agoPerhaps something like:
Table 1 =
VAR __year = MAX('Table'[Year])
VAR __yearPrev = __year - 1
VAR __month = MAXX(FILTER('Table',[Year]=__year),[Month])
VAR __table = FILTER('Table',[Year] = __year || ([Year] = __yearPrev && [Month] > __month))
RETURN
SUMMARIZE(__table,[Year],[Month],"My Column",SUM([Value]))
Also, I feel that this link might come in handy for you:
sabeensp
Helper IV
7 years agoThanks
VAR __month = MAXX(FILTER('Table',[Year]=__year),[Month]) -- This row is not letting meselect Month from the table
- Greg_Deckler7 years ago
Community Champion
Make sure to replace 'Table' with the name of your actual table. Does your table have a Month column? I have this working in a model, you want "Table 1" in the attached file. This builds a table based upon the "Calendar" table.
- sabeensp7 years ago
Helper IV
Thanks, I missed typed your MAXX with MAX,