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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Finding previous date's value in one column based on another column

Hello everyone,

 

I really got stuck with this one. I can't find any help for the PREVIOUSDAY function. I need to add a column with the previous date's value for a certain value in another column. My dates are not continuous. Example:

Segment             Date        UniqueOpenRate
WiFi                    1/3/2020 15%
Hotel concierge 1/3/2020 14%
WiFi                    2/3/2020 16%
Hotel Concierge 2/3/2020 13%

 

I need to be able to add a new column where I set the previous value for each Segment:

Segment            Date        PrevOpenRate
WiFi                   2/3/2020 15%

 

How can I do that?
Thanks!
Stan

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This works! Thank you so much! Yuu saved me so much time!

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @Anonymous 

try Measure

Measure = 
var _curDate = MAX('Table'[Date])
var _prevDate = CALCULATE(MAX('Table'[Date]), ALLEXCEPT('Table','Table'[Segment]),'Table'[Date] < _curDate)

RETURN

CALCULATE(SUM('Table'[UniqueOpenRate]), FILTER(ALLEXCEPT('Table','Table'[Segment]),'Table'[Date] = _prevDate))

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

This works! Thank you so much! Yuu saved me so much time!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.