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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.