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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Show Datediff value on today's date instead of the last record

Hi all,

 

I have a table with several records for each single candidate to track what steps they did in a process and the date in which they entered that step.

 

I want to see in a line chart how many days a candidate has either 1) been in a specific step (X) and are waiting an approval to move next OR 2)  have moved forward (from X to X+1). If 1), then they are considered pending and the diff of how many days should be done between the date of X and today, and the difference should be displayed for such candidate on today's date.

 

I created the visual, the time spent is calculated correctly as DIFF, but the DIFF value is shown in X instead of Today , and that's because the last record avaialbe for a candidate is for that pending step dates in November.

Be aware: The visual is working fine for case  2), but not for case 1)

BaronSdG_2-1688978887943.png

 

Below some examples of candidates in pending steps which is equal to the last step they have done so far

 

 

BaronSdG_3-1688978887945.png

 

 

How can I show the DIFF days of these candidates in todays date instead of November?

Be aware that this visual is working fine for the case 2)

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous . a new column

= datediff([updated_date], today(), day)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak  and thanks for replying,

 

At the moment I already have a diff formula in place, which is working in returning the difference value. The problem is this part of the sentence: 

1), then they are considered pending and the diff of how many days should be done between the date of X and today, and the difference should be displayed for such candidate on today's date.

 

Atm the difference is computed as mentioned but you, but the value is returned on the updated date instead of today's date

 
Here is the formula I am using, which 
DATEDIFF_OffSub-Offer =

var DateOffSub= MAXX(
    FILTER(LevOpportunity_stageChanges, LevOpportunity_stageChanges[toStageId] = "0490c6eb-d3c0-4a13-9e4c-2769e4d38770" && EARLIER(LevOpportunity_stageChanges[mainId])= LevOpportunity_stageChanges[mainId]),
    LevOpportunity_stageChanges[updatedAt])

var DateOffer=    MAXX(
    FILTER(LevOpportunity_stageChanges, LevOpportunity_stageChanges[toStageId] = "1afee169-6a11-4e0f-9ebd-5a01c8df3f1e" && EARLIER(LevOpportunity_stageChanges[mainId])= LevOpportunity_stageChanges[mainId]),
    LevOpportunity_stageChanges[updatedAt])
 
//If the candidate is still open, I make the difference between the last update and today, but this returns the value on the updated date, and not on today
 var DateDifference= IF(
    ISBLANK(DATEDIFF(DateOffSub,DateOffer,DAY)),
    DATEDIFF(DateOffSub,TODAY(),DAY),
    DATEDIFF(DateOffSub,DateOffer,DAY))

return

DateDifference

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.