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

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

Reply
Anonymous
Not applicable

How to copy a column of dates but that the dates are those recorded before the date

Very good, I am trying to create a column PREVIOUS DATES which I must take out of a swing DATES, the dates have different difference of days since they are updated every 2.3 or up to 6 days apart so a -1 does not help me.

CRISMAXWELL10_0-1595618385178.png

If you see the image of my felling the dates of Previous Date and Date are the same.

I'd like to know if there's a way to leave the dates like this:

CRISMAXWELL10_2-1595618690378.png

Any DAX commands that can help me?



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You want measure or column?

I'll provide you both formula.

Measure = CALCULATE(MAX('Table'[date]),FILTER(ALLSELECTED('Table'),'Table'[date]<SELECTEDVALUE('Table'[date])))

Column = CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[date]<EARLIER('Table'[date])))

 1.PNG2.PNG

 

Best Regards,

Jay

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

You want measure or column?

I'll provide you both formula.

Measure = CALCULATE(MAX('Table'[date]),FILTER(ALLSELECTED('Table'),'Table'[date]<SELECTEDVALUE('Table'[date])))

Column = CALCULATE(MAX('Table'[date]),FILTER('Table','Table'[date]<EARLIER('Table'[date])))

 1.PNG2.PNG

 

Best Regards,

Jay

Anonymous
Not applicable

Columnans works perfect. Thanks a lot.

Pragati11
Super User
Super User

Hi @Anonymous ,

 

Try following steps:

  1. Create an INDEX column in your data by going to Query Editor under ADD COLUMNS section.

Pragati11_0-1595619796702.png

 

2. You will have data something like this:

Pragati11_1-1595619849632.png

 

3. Then create the following measure and you will get expected result.

Prev Date Value = CALCULATE(MAX(ClothingSales[Date]), FILTER(ClothingSales, ClothingSales[Index] = EARLIER(ClothingSales[Index]) - 1))
 
Modify the DAX expression above with your tablename and column name.
 
p1.png
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Grax, but I dealt with this and the query editor didn't recognize me from the table I created.

Thank you from all the maeras.

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.