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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Find the number of days for a task to close

Hello,

 

I apologize if this question is previously asked. Here is my doubt. 

I have a discrepancy open date and discrepancy closed date. If the discrepancy is not resolved, the closed date is blank but if it is, there is a value for it. In the table below, I want to add a column that tells since how many days and months (2 separate columns for month and days will also work) is the discrepancy still open.

 

The image below shows the most recent data, but we have instances where discrepancies are open for months and I'd like to color code them (eg, if case is open for less than 1 month, then green, it is between 1-3 months then yellow, if open beyond 3 months, then red)

 

Really appreciate any help

 

Capture.PNG

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous  ,

Here are the steps you can follow:
If a discrepancy is still open, it doesn't show up:

1. You can change your function to the following style:

Column 2 =
iF(ISBLANK([Discrepancy.CloseDateTime]), DATEDIFF([Discrepancy.OpenDateTime], TODAY(),DAY), BLANK())

Result:

v-yangliu-msft_0-1615164115938.jpeg

Color the required datediff:

1. Select column Datediff-select Conditional formatting-Background color

v-yangliu-msft_1-1615164115943.png

2. In the Background color interface, Format by selects Rules, Based on field selects datediff, and then color labels according to the rules

v-yangliu-msft_2-1615164115945.png

3. Result:

v-yangliu-msft_3-1615164115949.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

 

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous  ,

Here are the steps you can follow:
If a discrepancy is still open, it doesn't show up:

1. You can change your function to the following style:

Column 2 =
iF(ISBLANK([Discrepancy.CloseDateTime]), DATEDIFF([Discrepancy.OpenDateTime], TODAY(),DAY), BLANK())

Result:

v-yangliu-msft_0-1615164115938.jpeg

Color the required datediff:

1. Select column Datediff-select Conditional formatting-Background color

v-yangliu-msft_1-1615164115943.png

2. In the Background color interface, Format by selects Rules, Based on field selects datediff, and then color labels according to the rules

v-yangliu-msft_2-1615164115945.png

3. Result:

v-yangliu-msft_3-1615164115949.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

 

Anonymous
Not applicable

I created a new column called Datediff and this is the formula - 

datediff = IF(ISBLANK(Discrepancy[Discrepancy.CloseDateTime]), DATEDIFF(Discrepancy[Discrepancy.OpenDateTime], TODAY(),DAY), DATEDIFF(Discrepancy[Discrepancy.OpenDateTime], Discrepancy[Discrepancy.CloseDateTime],DAY))
 
The issue with this formula is - if a discrepancy is still open, it doesn't show up. I think it has something to do with isblank. What I'm basically trying is to say that if the column Discrepancy.DiscrepancyClosedDateTime is blank, then datediff is OpenedDate - Today. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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