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
Bobbys
Helper III
Helper III

Average of averages

Hi everyone.

 

I'm struggling with making my Matrix visual show the average of the column. 

Bobbys_0-1664971819112.png

Note that the values for each row are averages as well. This is the DAX I've used: 

COGS endring1 = AVERAGEX(VALUES('calendar'[Time period sort]), [COGS previous period])
The total should be (0 + 0 + 0,39 + 0,17) / 4 = 0,14
Any help would be well appreciated

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Bobbys ,

 

COGS_ending1 =
VAR _COGS_ending1 =
    AVERAGEX ( VALUES ( 'calendar'[Time period sort] ), [COGS previous period] )
VAR _SUMMAIRZE =
    SUMMARIZE (
        'Table',
        [Product],
        "COGSendring1", AVERAGEX ( VALUES ( 'calendar'[Time period sort] ), [COGS previous period] )
    )
RETURN
    IF (
        HASONEVALUE ( 'Table'[Product] ),
        _COGS_ending1,
        AVERAGEX ( _SUMMAIRZE, [COGSendring1] )
    )

In my sample, the [COGS previous period] part equal to average(table[]value]). Result is as below.

RicoZhou_0-1665475400787.png

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
Bobbys
Helper III
Helper III

Anyone?

Anonymous
Not applicable

Hi @Bobbys ,

 

COGS_ending1 =
VAR _COGS_ending1 =
    AVERAGEX ( VALUES ( 'calendar'[Time period sort] ), [COGS previous period] )
VAR _SUMMAIRZE =
    SUMMARIZE (
        'Table',
        [Product],
        "COGSendring1", AVERAGEX ( VALUES ( 'calendar'[Time period sort] ), [COGS previous period] )
    )
RETURN
    IF (
        HASONEVALUE ( 'Table'[Product] ),
        _COGS_ending1,
        AVERAGEX ( _SUMMAIRZE, [COGSendring1] )
    )

In my sample, the [COGS previous period] part equal to average(table[]value]). Result is as below.

RicoZhou_0-1665475400787.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Bobbys
Helper III
Helper III

Thanks for the response @amitchandak
I've tried that already. The problem with that is that my totals dissapear when using Values(Table[Product]). 

Bobbys_0-1664995942913.png

 

No idea why... 

amitchandak
Super User
Super User

@Bobbys , if the product is above the time then it needs to like

 

COGS endring1 = AVERAGEX(VALUES('Product'[Product]), [COGS previous period])

 

till product level follow aggregation of measure - COGS previous period

post that avg of products

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.