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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
eugeneawj
Regular Visitor

Minimum Date with Mulitple Conditions (Power Query)

Hi there,

 

I was wondering how do I convert the DAX below to a Power Query expression:

 

Column = calculate(MIN(table[date]), ALLEXCEPT( table, table[col1], table[col2]))

 

I figure out how to do it with just 1 filter condition, but not sure how to do the same with 2

DAX:

 

Column = calculate(MIN(table[date]), ALLEXCEPT( table, table[col1]))

 

Power Query: 

 

List.Min(Table.SelectRows(#"Changed Type",(x)=>x[col1]=[col1])[date])

 

This is my attempt at trying to do so with 2 conditions but I am unsure if it is correct:

 

List.Min(Table.SelectRows(#"Changed Type",(x)=>x[col1]=[col1] and x[col2]=[col2])[date])

 

Any help would be much appreciated! Thanks in advance !!

Eugene

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@eugeneawj,

 

Try using Group By in Power Query:

 

DataInsights_0-1626192538927.png

 

Sample data:

 

DataInsights_1-1626192572881.png

 

Result:

 

DataInsights_2-1626192604908.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Icey
Community Support
Community Support

Hi @eugeneawj,

 

// This is my attempt at trying to do so with 2 conditions but I am unsure if it is correct:

 

List.Min(Table.SelectRows(#"Changed Type",(x)=>x[col1]=[col1] and x[col2]=[col2])[date])

 

 

Based on my test, it returns the correct value in my sample.

custom1.PNG

 

In addition to your method and @DataInsights 's, you can also try something like so:

custom.PNG

 

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @eugeneawj,

 

// This is my attempt at trying to do so with 2 conditions but I am unsure if it is correct:

 

List.Min(Table.SelectRows(#"Changed Type",(x)=>x[col1]=[col1] and x[col2]=[col2])[date])

 

 

Based on my test, it returns the correct value in my sample.

custom1.PNG

 

In addition to your method and @DataInsights 's, you can also try something like so:

custom.PNG

 

 

Best Regards,

Icey

 

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

DataInsights
Super User
Super User

@eugeneawj,

 

Try using Group By in Power Query:

 

DataInsights_0-1626192538927.png

 

Sample data:

 

DataInsights_1-1626192572881.png

 

Result:

 

DataInsights_2-1626192604908.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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