Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Sum of Averages in calc column

I am trying to find dax for Sum of Averages in calc column.

Here is a dataset with desirable column:

 

Week idCategoryProductSalesAvg Sales per ProductSum of Avg Sales per Product
1HomeAA115
2HomeAA115
3HomeAA115
1HomeBB745
2HomeBB145
2GardenCC6613
3GardenCC6613
4GardenCC2613
5GardenCC10613
6GardenCC4613
8GardenCC8613
4GardenDD7713

 

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. 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@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]
)

Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@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]
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.