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
fisqkuz1
Frequent Visitor

average of sumx calculation where results of measure > 0

Hi,

 

I am looking to get the average of a column which was calculated with SUMX. If get that it's not working because dax doesn't know the context, however I can't seem to figure this out.

 

Example:

 

test = SUMX(table1, table1[c1] - table1[2])

and then I want IF test > 0 -> take into account to average.

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @fisqkuz1 

 

You can try this measure

AVG = AVERAGEX(FILTER('Table1','Table1'[C1]-'Table1'[C2]>0),'Table1'[C1]-'Table1'[C2])

 

Below is my sample data and measure result. 

vjingzhang_0-1648806956162.png

 

If this is not what you want, can you provide some sample data and expected result so that we can try to come up with a more accurate solution?

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @fisqkuz1 

 

You can try this measure

AVG = AVERAGEX(FILTER('Table1','Table1'[C1]-'Table1'[C2]>0),'Table1'[C1]-'Table1'[C2])

 

Below is my sample data and measure result. 

vjingzhang_0-1648806956162.png

 

If this is not what you want, can you provide some sample data and expected result so that we can try to come up with a more accurate solution?

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

amitchandak
Super User
Super User

@fisqkuz1 , if Test is a measure it needs a group by to check >0

 

Averagex(filter(Values(Table[Column]), [Test] >0), [Test])

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
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.