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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate a value on last non blank date

I have a list of dates and some values associated to them as shown below. I want to calculate the value which was on previous date.

 

I have ranked the dates and I am trying to find the value of the column on the previous rank but I get blanks.

 

Rank By Date = RANK.EQ('P5: Previous month value'[Date],'P5: Previous month value'[Date], ASC)

 

required value calc = CALCULATE(MAX('P5: Previous month value'[Users]), 'P5: Previous month value'[Rank By Date] = 'P5: Previous month value'[Rank By Date] - 1)

 

date valuerequired output
08/21/201810
08/23/201821
09/01/201852
09/02/201815
09/03/201821
09/04/201832
09/05/201833
09/06/201843
09/07/201854
09/08/201865

 

previous date value.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous,

Create the column using DAX below.

required value calc = var pre =CALCULATE(MAX('P5: Previous month value'[value]),FILTER('P5: Previous month value','P5: Previous month value'[Rank By Date]=EARLIER('P5: Previous month value'[Rank By Date])-1)) return IF(ISBLANK(pre),0,pre)

2.PNG

Regards,
Lydia

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Anonymous,

Create the column using DAX below.

required value calc = var pre =CALCULATE(MAX('P5: Previous month value'[value]),FILTER('P5: Previous month value','P5: Previous month value'[Rank By Date]=EARLIER('P5: Previous month value'[Rank By Date])-1)) return IF(ISBLANK(pre),0,pre)

2.PNG

Regards,
Lydia

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors