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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
olives
Helper I
Helper I

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

watkinnc
Super User
Super User

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

 

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

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

3 REPLIES 3
watkinnc
Super User
Super User

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

 

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

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
wdx223_Daniel
Super User
Super User

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

@wdx223_Daniel 
Thank you😊

It worked😀

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors