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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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())

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())

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