Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
User | Count |
---|---|
77 | |
75 | |
46 | |
31 | |
28 |
User | Count |
---|---|
99 | |
93 | |
50 | |
49 | |
46 |