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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
GryphonKD
Frequent Visitor

Which is the 'Right' way to operate on a summary table. Average of Averages

Hi Dax gurus,

 

I have previously used Dax measures to calculate operands on summaries.  Could be Average of Sums, or Sums of averages etc..

I'm currently doing an Average of Averages - except there are some usual results.

Normally I put it all in one measure, and perform an AverageX on a Summarization.

No doubt there are countless posts on this type of problem; here is another, doing the same thing in a slightly differently written measure:

https://community.fabric.microsoft.com/t5/Desktop/How-to-perform-an-average-of-an-average/td-p/16726...

 

here's my measure:

 

AVAV-CP-measure =

AVERAGEX(

    SUMMARIZE(WW_Hourly, HouseInfo_Table[Heating & Cooling], HouseInfo_Table[Classfication], "AV-Cooling",

    CALCULATE(

            AVERAGE('WW_Hourly'[Cooling_power]),

            FILTER(WW_Hourly,WW_Hourly[Cooling_power]>0)

    )

),[AV-Cooling]

)

 

I thought I'd compare this, by generating a summary table first, using the same DAX:

 

Test_Summary_Table =

SUMMARIZE(WW_Hourly, 'HouseInfo_Table'[Heating & Cooling], 'HouseInfo_Table'[Classfication] , "AV-Cooling",

    CALCULATE(AVERAGE('WW_Hourly'[Cooling_power]),

    FILTER(WW_Hourly,WW_Hourly[Cooling_power]>0)

    )

)

 

Then get the results through a basic Average measure on that Summary table:

 

AVAV_CP_Table = AVERAGE('Test_Summary_Table'[AV-Cooling])

 

here are the results, from the two approaches:

GryphonKD_0-1738629823820.png

 

 

The results from the summary tables are a little different, and so the final results, in the context of classification are a little different:
 

GryphonKD_1-1738629823821.png

 

Does anyone know why this could be, and which is the right way? I might have to apply this to simpler dataset to check which method got the summary table correct.

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @GryphonKD ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
anmolmalviya05
Super User
Super User

Hi @GryphonKD , Please try the below measure:

Test_Summary_Table =
SUMMARIZE(
WW_Hourly,
HouseInfo_Table[Heating & Cooling],
HouseInfo_Table[Classfication],
"AV-Cooling",
CALCULATE(
AVERAGE(WW_Hourly[Cooling_power]),
FILTER(ALL(WW_Hourly), WW_Hourly[Cooling_power] > 0)
)
)

danextian
Super User
Super User

Hi @GryphonKD 

 

Don't use SUMMARIZE to add calculated columns. 

ADDCOLUMNS (
    SUMMARIZE (
        WW_Hourly,
        'HouseInfo_Table'[Heating & Cooling],
        'HouseInfo_Table'[Classfication]
    ),
    "AV-Cooling",
        CALCULATE (
            AVERAGE ( 'WW_Hourly'[Cooling_power] ),
            FILTER ( WW_Hourly, WW_Hourly[Cooling_power] > 0 )
        )
)

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Users online (1,234)