Forum Discussion
Anonymous
4 years agoNot applicable
Group by + avg
Hello guys, I need to help with following group by and average dax formula my data y_m value 2022_1 1 2022_1 2 2022_1 ...
- 4 years ago
Anonymous Measures cannot return tables. Your original formula works for me to create a table:
Table 2 = GROUPBY('Table','Table'[y_m],"result",AVERAGEX(CURRENTGROUP(),'Table'[value]))Also, it works in a measure to create a table var:
Measure = VAR __Table = GROUPBY('Table','Table'[y_m],"result",AVERAGEX(CURRENTGROUP(),'Table'[value])) VAR __y_m = MAX('Table'[y_m]) RETURN MAXX(FILTER(__Table,[y_m] = __y_m),[result])
Anonymous
4 years agoNot applicable
Hello Greg_Deckler
but I need that output will be table not one value
Greg_Deckler
Community Champion
4 years agoAnonymous Measures cannot return tables. Your original formula works for me to create a table:
Table 2 = GROUPBY('Table','Table'[y_m],"result",AVERAGEX(CURRENTGROUP(),'Table'[value]))
Also, it works in a measure to create a table var:
Measure =
VAR __Table = GROUPBY('Table','Table'[y_m],"result",AVERAGEX(CURRENTGROUP(),'Table'[value]))
VAR __y_m = MAX('Table'[y_m])
RETURN
MAXX(FILTER(__Table,[y_m] = __y_m),[result])