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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
CCWhatsup
New Member

Help with DATEDIFF?

Hi,

 

I have a visual with 2 dates from different tables that I need to get the difference between in order to get actual response times for our calls.

 

Column 1 is:  Job[Job_Created_Date]

Column 2 is:  JobResourceWorkTime[Work_time_start]

 

Column 2 has been filtered on the visual by earliest as I dont want all of the time logs from JobResourceWorkTime and get multiple entries for each job, I just want the first one.

Column 2 has also been filtered by JobresourceWorkTime[Work_time_type] = "working time" otherwise travel times would show up as well and show when an engineer had started their travel to a call instead of when they arrived.

 

Is there a way that I can recreate these filters as a part of the same formula as a DATEDIFF?

 

Thanks in advance.

 

 

4 REPLIES 4
Anonymous
Not applicable

HI @CCWhatsup ,

I'd like to suggest you write measure for dynamic calculation result, current power bi not support to create dynamic calculated column/table based on filter/slicer.

If you confused on coding formula, please share some sample data and expected result for test.

Regards,
Xiaoxin Sheng

jdbuchanan71
Super User
Super User

Hello @CCWhatsup 

Give this a try.

Days =
DATEDIFF (
    SELECTEDVALUE ( Job[Job_Created_Date] ),
    CALCULATE (
        MIN ( JobResourceWorkTime[Work_time_start] ),
        JobresourceWorkTime[Work_time_type] = "working time"
    ),
    DAY
)

 

Thanks for the reply. This seems to generate blank results in the column that it creates. No errors though.

@CCWhatsup 

Are you trying to add this as a calculated column or in a card visual or matrix?  Could you share your .pbix file and show the location where you are trying to add the value?  It will help us to give you the right answer.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.