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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Date diff and Avg

Dear Sir

 

i have one table as shown:

Capture.JPG

i want to calculate avearge of delay in days

here some condition:,

final date=    if(actual date=blank,plan date,actual date)

delay= final date - forecast date

calculate Average of delay where delay>0 ??

 

How can i get this by measures ??

3 REPLIES 3
jaideepnema
Solution Sage
Solution Sage

Hi @Anonymous ,

You can create a calculated column to calculate delay

 

Delay =
var finaldate=if(ISBLANK('Table'[Actual Date]),'Table'[Plan Date],'Table'[Actual Date])
var delay=DATEDIFF('Table'[Forecast Date],finaldate,DAY)
return delay
 
And a measure like to calculate average delay:
average delay = CALCULATE(AVERAGE('Table'[Delay]),FILTER('Table','Table'[Delay]>0))
 

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Connect with me on LinkedIn: https://www.linkedin.com/in/jaideepnema/

Anonymous
Not applicable

any way to do without creating calculated column ??

Anonymous
Not applicable

HI @Anonymous,

You can add a variable with summarize function to summary table records and add the custom field with calculated expression, then you can use the iterator function to apply the second aggregations.

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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