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
Strahinja
New Member

AVERAGE of subtraction two columns with condition

Hello guys,

 

I have some maybe easy question for you, but I am new in DAX and its difficult for me.

 

I want to create one mesare without adding new column. 

Measure shoul calculate average of end_date - start_date. But there is one condition. If differece between end_date and start_date smaller than two (end_date - start_date < 2) , that row should not count towards the average. 

 

And, at the end I want to Measure be in form on integer.

 

Strahinja_0-1667425646664.png

 

Thank you guys! 😄 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

AVERAGEX(Table,VAR _diff=Table[End date]-Table[Start Date] RETURN IF(_diff>2,_diff))

View solution in original post

2 REPLIES 2
Strahinja
New Member

Thank you my brother @wdx223_Daniel 😄

I am really thankful!!! 😎

wdx223_Daniel
Super User
Super User

AVERAGEX(Table,VAR _diff=Table[End date]-Table[Start Date] RETURN IF(_diff>2,_diff))

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.