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

Get max date with conditions by Query

Hi,

 

I have a Calendar table and I am trying to get max date with conditions by Query.

How can I get 1/3/2021 (max date & holiday=1)?

 

Calendar table

dateholiday
1/1/20211
1/2/20211
1/3/20211
1/4/20210
1/5/20210

 

I have try this but those are returning  1/5/2021.

 

= List.Max(Calendar[date], each [holiday]= 1)
= List.Max(Calendar[date], each [holiday]= 0)

 

 

Any help would be greatly appreciated.

2 ACCEPTED SOLUTIONS
wdx223_Daniel
Super User
Super User

=List.Max(Table.SelectRows(Calendar,each [holiday]=1)[date])

View solution in original post

Anonymous
Not applicable

You could also just use Table.Max, which lets you use two parameters, like

 

=Table.Max(PriorStepOrTableName, {"Date", "Holiday"})

 

--Nate

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

You could also just use Table.Max, which lets you use two parameters, like

 

=Table.Max(PriorStepOrTableName, {"Date", "Holiday"})

 

--Nate

wdx223_Daniel
Super User
Super User

=List.Max(Table.SelectRows(Calendar,each [holiday]=1)[date])

Anonymous
Not applicable

@wdx223_Daniel 
Thank you😊

It worked😀

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 Kudoed Authors