Forum Discussion
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
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.
In addition to your method and DataInsights 's, you can also try something like so:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- DataInsightsSuper User
- IceyCommunity 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.
In addition to your method and DataInsights 's, you can also try something like so:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.