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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AV_04
Helper I
Helper I

DAX Help

 Hi guys,

 

Requesting your help for a DAX command. PFB the sample tables:

 

Category  Dist         Value

A0200
B100300
C0400
D300500
E0100
F400300

 

Category    Dist        Value

A0200
B0300
C0400
D0500
E0100
F0300

 

From the above two tables, I need to find the average of Dist - average of values where dist should not be zero. For example, from the first table the average of dist comes to be 266.66(neglecting zeros) and average of Value- 300, for the second table, the avg of dist-0 and average of value is 300, Can anyone help me with the dax formula. I used the below formula but it filtered some records.

 

Calculate((average(dist))- (average(value)), filter(table1,table1[dist]<>0)),

 

the above formula filters the values records also. appreciate if anyone can help me with this requirement.

 

Thank you!

2 REPLIES 2
AV_04
Helper I
Helper I

@tamerj1could  you help me with the dax fn?

HI @AV_04 
Please try

=
CALCULATE ( AVERAGE ( 'Table'[dist] ), 'Table'[dist] <> 0 )
    - AVERAGE ( 'Table'[Value] )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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