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! Learn more

Reply
Anonymous
Not applicable

power query date help

Hi, 

 

I have two tables read from data in spreadsheet. The first query has a column of dates (apart from many other columns) and the second query has a single col/row containing AsOf Date. I want to check whether the dates in my first query are in past/or in future compared to AsOf Date.

Table1[XYZdates]   -- Table1 has 10 columns and 10 rows. One of the columns contain dates. 

Table2[AsOf]   -- Table2 is just a query of a single date picked from a spreadsheet. 

 

I'm trying to add another column to Table1 in Power Query that tells me 'Y/N' depending on whether XYZdates is greater than or less than AsOf date. 

 

How best do we achieve this?

 

Thanks.

  

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try like this:

 

= Table.AddColumn(#"Reordered Columns", "Custom", each if [XYZdates] >= Table2[AsOf]{0} then "Y" else "N")

 

2.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try like this:

 

= Table.AddColumn(#"Reordered Columns", "Custom", each if [XYZdates] >= Table2[AsOf]{0} then "Y" else "N")

 

2.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , In dax this will give you max date from table2 to  a new column in table 1 =maxx(Table2,Table2[AsOf date])

 

In M you have List.Max and Table.Max that you can try to use

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

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.

Top Solution Authors