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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
karlamaddox1
Helper I
Helper I

How to calculate date difference based on a column value

Hi, 

 

I have calculated the date difference between the start (Date of Entry) and End (Ticket Completion Time). 

I am wondering how I can get this value based on another column I have called Ticket status. I want it to only give me the date difference if the column value is completed and NOT working. 

 

BI TIme To Resolve Date Diff = DATEDIFF('ABF Unique Address Request form V1 (2)'[Date of Entry].[Date], 'ABF Unique Address Request form V1 (2)'[TicketCompletionTIme], DAY)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@karlamaddox1 , based on what I got

 

BI TIme To Resolve Date Diff = if([Ticket status] in {Completed", "Not Working"} , DATEDIFF('ABF Unique Address Request form V1 (2)'[Date of Entry].[Date], 'ABF Unique Address Request form V1 (2)'[TicketCompletionTIme], DAY), blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @karlamaddox1 

Try

 

BI TIme To Resolve Date Diff =
IF (
    'ABF Unique Address Request form V1 (2)'[Ticket status] <> "working" && 'ABF Unique Address Request form V1 (2)'[Ticket status] = "completed",
    DATEDIFF (
        'ABF Unique Address Request form V1 (2)'[Date of Entry].[Date],
        'ABF Unique Address Request form V1 (2)'[TicketCompletionTIme],
        DAY
    )
)

 

amitchandak
Super User
Super User

@karlamaddox1 , based on what I got

 

BI TIme To Resolve Date Diff = if([Ticket status] in {Completed", "Not Working"} , DATEDIFF('ABF Unique Address Request form V1 (2)'[Date of Entry].[Date], 'ABF Unique Address Request form V1 (2)'[TicketCompletionTIme], DAY), blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

You got it! It worked! Thank you. Accepted as solution 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.