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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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