The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
Try using Group By in Power Query:
Sample data:
Result:
Proud to be a Super User!
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.
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.
Try using Group By in Power Query:
Sample data:
Result:
Proud to be a Super User!