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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Maryam_Pour
Frequent Visitor

How to measure Days Late only for certain values?

Hi All,

Hope you can help me with this issue, as it took me a couple of hours today, and I didn't figure it out yet 😞
I want to calculate the number of "Days late" only for the Overdue Status and "Days to Reply" for the Outstanding status.
Responded and N/A status will be Null.

 

Maryam_Pour_2-1628511831276.png

 

This is what I came to but it's not working:

DaysLate = IF(ISBLANK(Mailbox[ResponseRequiredDate]),"",
IF(Mailbox[ResponseRequiredDate]>TODAY(), IF(Mailbox[Status] = "Overdue", DATEDIFF(Mailbox[ResponseRequiredDate],TODAY(),DAY), ""

 

I appreciate your help 🙂

 

//Maryam

 

 

 

 

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Maryam_Pour 

try the measure

Days Late = IF(MIN('Table'[Status])="Overdue",DATEDIFF(MIN('Table'[ResponseReq]),TODAY(),DAY))
Days to Reply = IF(MIN('Table'[Status])="Outstanding",DATEDIFF(TODAY(),MIN('Table'[ResponseReq]),DAY))

result

vxiaotang_0-1628754509729.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @Maryam_Pour 

try the measure

Days Late = IF(MIN('Table'[Status])="Overdue",DATEDIFF(MIN('Table'[ResponseReq]),TODAY(),DAY))
Days to Reply = IF(MIN('Table'[Status])="Outstanding",DATEDIFF(TODAY(),MIN('Table'[ResponseReq]),DAY))

result

vxiaotang_0-1628754509729.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

It works perfectly. Thank you so much 😊

selimovd
Super User
Super User

Hey @Maryam_Pour ,

 

you can get the days late with overdue with the following measure:

Days Late with Overdue =
CALCULATE(
    COUNTROWS( myTable ),
    myTable[Status] = "Overdue" && myTable[Days Late] = "*"
)

  

And days to reply with outstanding like this:

Days to Reply Outstanding =
CALCULATE(
    COUNTROWS( myTable ),
    myTable[Status] = "Outstanding" && myTable[Days to Reply] = "*"
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

Hi Denis,

Appreciate your quick reply.
It seems that I didn't explain my issue correctly. Sorry.
I want to calculate the number of days from the ResponseRequiredDate to Today and call the new column "Days Late" for all Overdue mails. And then, I want to calculate the number of days for Outstanding mails from Today and call the column "Days to Reply."

*** The stars are only to show where the new values should be added.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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