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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
JustinDoh1
Post Prodigy
Post Prodigy

Question on AVERAGEX

I have been using this DAX for long time, and now I would like to analyze it.

I have uploaded my PBIX file here.

 

Here is my DAX:

 

Averagex =
AVERAGEX(
        FILTER
            (
            SUMMARIZE(      
                    'Table',
                    'Date'[DateFormat],
                    "ClientID_M", [ClientID_M]
                     ),
            [ClientID_M] > 0  
            ),
            [ClientID_M]
        )
 
According to the syntax of AVERAGEX, it is:
AVERAGEX(<table>,<expression>)
 
Update on 9/12/2025:
Question: I am trying to see where <expression> is on this code.
1 ACCEPTED SOLUTION
v-dineshya
Community Support
Community Support

Hi @JustinDoh1 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please check below steps for detail explaination of your DAX code with sample example.

 

1. SUMMARIZE ( 'Table', 'Date'[DateFormat], "ClientID_M", [ClientID_M] )

The above syntax produces a virtual table with One row per 'Date'[DateFormat]. A calculated column "ClientID_M" holding the value of your [ClientID_M] measure for that date. You are trying to generate like below sample data.

 

DateFormat    ClientID_M

01-01-2025     12
02-01-2025     15
03-01-2025      0


2. FILTER ( … , [ClientID_M] > 0 ), It removes rows where [ClientID_M] <= 0, so you are trying to ignore zeros/negatives. Now your virtual table looks like below sample data.

 

DateFormat    ClientID_M


01-01-2025    12
02-01-2025    15

 

3. AVERAGEX ( table, [ClientID_M] ), It iterates over each row in that filtered summarized table, and evaluates [ClientID_M] for that row. It is the average of [ClientID_M] across all dates where it’s > 0.

 

Note: Your measure calculates the average of [ClientID_M] at the date level (one row per DateFormat), ignoring the dates where the measure is 0 or negative.

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

View solution in original post

7 REPLIES 7
FBergamaschi
Solution Sage
Solution Sage

Hi @JustinDoh1,

what are you asking us? you want me to explain in words what your DAX code is doing? Or ?

 

Thanks

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

v-dineshya
Community Support
Community Support

Hi @JustinDoh1 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please check below steps for detail explaination of your DAX code with sample example.

 

1. SUMMARIZE ( 'Table', 'Date'[DateFormat], "ClientID_M", [ClientID_M] )

The above syntax produces a virtual table with One row per 'Date'[DateFormat]. A calculated column "ClientID_M" holding the value of your [ClientID_M] measure for that date. You are trying to generate like below sample data.

 

DateFormat    ClientID_M

01-01-2025     12
02-01-2025     15
03-01-2025      0


2. FILTER ( … , [ClientID_M] > 0 ), It removes rows where [ClientID_M] <= 0, so you are trying to ignore zeros/negatives. Now your virtual table looks like below sample data.

 

DateFormat    ClientID_M


01-01-2025    12
02-01-2025    15

 

3. AVERAGEX ( table, [ClientID_M] ), It iterates over each row in that filtered summarized table, and evaluates [ClientID_M] for that row. It is the average of [ClientID_M] across all dates where it’s > 0.

 

Note: Your measure calculates the average of [ClientID_M] at the date level (one row per DateFormat), ignoring the dates where the measure is 0 or negative.

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

Hi @JustinDoh1 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

@v-dineshya Actually, somehow, my post was published it, intending to delete after I figured out by myself. Sorry about that. But, I was trying to break down each piece and understand where the <expression> is for that AVERAGEX code. Thank you.

Hi @JustinDoh1 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

ThxAlot
Super User
Super User

ThxAlot_0-1757055906215.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



lbendlin
Super User
Super User

What do you want to analyze? The query plan?  You can use DAX Studio for that.

 

You would also need to investigate the code for the [ClientID_M] measure, and see if that has any issues by itself.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.