Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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 | 3 |
2022_2 | 4 |
2022_2 | 5 |
2022_2 | 6 |
2022_3 | 7 |
2022_3 | 8 |
2022_3 | 9 |
and I would like to get
y_m | value |
2022_1 | 2 |
2022_2 | 5 |
2022_3 | 8 |
I tried to this dax formula
Solved! Go to Solution.
@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 Just use measure = AVERAGE('Table'[value])
@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])
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |