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

Need to return the date after First Date of the column

Hello All,

Hope you all are doing alright, I want to return the next date after executing the FIRSTDATE() Dax function. I know there are two functions namely FIRSTDATE and LASTDATE but that does not fulfill my requirement. 

Kindly check the sample data below
Data snapshot.PNG
As you can see in the state name column there are 4 states for Under Progress having different dates for each. I want to return the date right after the first date of the state "Under Progress" i.e 8/16/2019. Your help is appreciated thank you.  

Cheers,

2 REPLIES 2
AlB
Super User
Super User

Hi @Tejaswini_Dahat 

Is it a measure that you are looking for? If so, create this and place it in a card visual:

 

Measure =
VAR FirstUnderProgress_ =
    CALCULATE ( MIN ( Table1[Date] ), Table1[State Name] = "Under Progress" )
RETURN
    CALCULATE ( MIN ( Table1[Date] ), Table1[Date] > FirstUnderProgress_, Table1[State Name] = "Under Progress" )

 

 

 

Hello @AlB,

Actually, I am looking for a calculated column that will help me calculate the date difference in days for each stage. Most applications follows the stages Submitted -> Under Progress -> Pending -> Verified. Some applications may not follow every stage so it can vary (e.g An application may have gone through Submitted and Under Progress stages only). 

 

I'm attaching my calculated columns below the screenshot for your reference. Capture.PNG

 

Capture 2.PNG


The issue that I am facing here is that I am getting the negative date difference it's because it is taking the first date of the next stage.

For example, if I want to calculate the date difference for Submitted to Under Progress. In the above screenshot, you can see that it has calculated the negative date difference for the same even though there were two dates for "Under Progress" that were associated with the same application. I want it in such a way that lastvalue should take the second oldest date that'll help me solve the problem. 

Thanks for your kind attention. Smiley Happy

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.