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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ffunky
Helper I
Helper I

column total average vs row total

Hi all,

 

I have rates of sale by week and store, and I'm trying to get the column total to show an average, like the row totals do, but the column seems to only sum up the totals.  It's driving me crazy!  😉  

 

In my table, I replaced all zeros with Null so it calculates the rows correctly.

 

USW = averagex(SUMMARIZE(TABLE,TABLE[WK_NBR],"abc",sum(TABLE[Null_Qty])),[abc])
 
The column averages should be 3.1, 3.3, 2.9, 3.2, 3.1 (there are more stores than shown in pic)
 
Capture.PNG
2 ACCEPTED SOLUTIONS

Hi @ffunky ,

 

Please refer to this measure.

Average Qty = AVERAGEX(SALES_WEEKLY,CALCULATE(SUM(SALES_WEEKLY[Null_Qty])))

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

A collegue here was able to find the solution to this.

 

Measure = AVERAGEX(

            ADDCOLUMNS(                SUMMARIZE(SALES_WEEKLY,SALES_WEEKLY[STORE_NBR],SALES_WEEKLY[YR_WK_NBR]),"Test",CALCULATE(SUM(SALES_WEEKLY[Null_Qty]))),[Test])

View solution in original post

7 REPLIES 7
ffunky
Helper I
Helper I

Much closer now - but - I can't make it not include the null values in the calculation.  For instance, store 1474 should be 1.5, not 0.3.  Any ideas out there?

 

 

Null_Qty average per STORE_NBR =
sumx(
    KEEPFILTERS(VALUES('SALES_WEEKLY'[UPC_CD])),
    CALCULATE(sumx(SALES_WEEKLY,'SALES_WEEKLY'[Null_Qty])/count(SALES_WEEKLY[UPC_CD]))
)
 
Capture.PNG

no ideas?  I'm still racking my brain on this one...  I'm at the point where bribery could be considered.  😉

 

This appears to be most accurate and colum totals at bottom are correct, but the total column needs to average the row, not sum them.

 

Null_Qty average per UPC_CD = 
AVERAGEX(
	KEEPFILTERS(VALUES('SALES_WEEKLY'[STORE_NBR])),
	CALCULATE(SUM('SALES_WEEKLY'[Null_Qty]))
)

 

Capture1.PNG

Hi @ffunky ,

 

Please refer to this measure.

Average Qty = AVERAGEX(SALES_WEEKLY,CALCULATE(SUM(SALES_WEEKLY[Null_Qty])))

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

A collegue here was able to find the solution to this.

 

Measure = AVERAGEX(

            ADDCOLUMNS(                SUMMARIZE(SALES_WEEKLY,SALES_WEEKLY[STORE_NBR],SALES_WEEKLY[YR_WK_NBR]),"Test",CALCULATE(SUM(SALES_WEEKLY[Null_Qty]))),[Test])

Anonymous
Not applicable

Hi!

 

you need to use "average per category" quick measure, enter to this link for see a example: AVERAGE SUBTOTAL.

 

 

That gets my column totals corrected, but the row totals and grand totals are off now.

 

Null_Qty average per STORE_NBR =
AVERAGEX(
    KEEPFILTERS(VALUES('SALES_WEEKLY'[STORE_NBR])),
    CALCULATE(SUM('Capture.PNGSALES_WEEKLY'[Null_Qty]))
)

Sorry - that pic butchered the formatting.

 

 
Null_Qty average per STORE_NBR = 
AVERAGEX(
	KEEPFILTERS(VALUES('SALES_WEEKLY'[STORE_NBR])),
	CALCULATE(SUM('SALES_WEEKLY'[Null_Qty]))
)
 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors