Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am trying to find dax for Sum of Averages in calc column.
Here is a dataset with desirable column:
Week id | Category | Product | Sales | Avg Sales per Product | Sum of Avg Sales per Product |
1 | Home | AA | 1 | 1 | 5 |
2 | Home | AA | 1 | 1 | 5 |
3 | Home | AA | 1 | 1 | 5 |
1 | Home | BB | 7 | 4 | 5 |
2 | Home | BB | 1 | 4 | 5 |
2 | Garden | CC | 6 | 6 | 13 |
3 | Garden | CC | 6 | 6 | 13 |
4 | Garden | CC | 2 | 6 | 13 |
5 | Garden | CC | 10 | 6 | 13 |
6 | Garden | CC | 4 | 6 | 13 |
8 | Garden | CC | 8 | 6 | 13 |
4 | Garden | DD | 7 | 7 | 13 |
It is summing Average Sales for each product within category. 1+4=5 or 6+7=13
I know you think it not make sens (why to sum up average Sales?) or I should do this in measure.
I know for the most of scenarios measure will be the right choice. But I need this in column. I need it for further more compex calculations.
Solved! Go to Solution.
@Anonymous
Try this column
Column = SUMX ( SUMMARIZE ( FILTER ( Table1, Table1[Category] = EARLIER ( Table1[Category] ) ), Table1[Category], Table1[Product], Table1[Avg Sales per Product] ), [Avg Sales per Product] )
@Anonymous
Try this column
Column = SUMX ( SUMMARIZE ( FILTER ( Table1, Table1[Category] = EARLIER ( Table1[Category] ) ), Table1[Category], Table1[Product], Table1[Avg Sales per Product] ), [Avg Sales per Product] )
User | Count |
---|---|
91 | |
77 | |
71 | |
65 | |
58 |
User | Count |
---|---|
103 | |
94 | |
75 | |
61 | |
58 |