cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Helper IV

Fill up columns with conditions in power query

Hi all

I have below table. Now I wanna create a "Max rate" columns with below logic:

Fill up the Max rate of max distance for 1 shipment in column" Max rate"

Ex: Shipment B have 2 rates with max distance ( 12) : 1719 and 1741  => fill up 1741 into " Max rate" column

So, is there any way to do it with POWER QUERY?

1 ACCEPTED SOLUTION
Community Support

Hi @ngocnguyen  ,

According to you description, You could copy the two tables first, and then group and merge .The steps are as follows

Step1: Coptwo tables

Step2: Group by

Step3: merge two tables and expanded tables

Step4: add conditional column and remove empty rows:

Step5: Group by

Step6 : merge two tables and expanded tables

The final output is shown below:

Best Regards,
Community Support Tea
m_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support

Hi @ngocnguyen  ,

According to you description, You could copy the two tables first, and then group and merge .The steps are as follows

Step1: Coptwo tables

Step2: Group by

Step3: merge two tables and expanded tables

Step4: add conditional column and remove empty rows:

Step5: Group by

Step6 : merge two tables and expanded tables

The final output is shown below:

Best Regards,
Community Support Tea
m_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

@ngocnguyen , You have this video deal with category max - if that can help

In DAX you can a new column

new column =
var _1 = maxx(filter(Table, [shipment no] =earlier([shipment no])),[distance])
return
maxx(filter(Table, [shipment no] =earlier([shipment no]) && [distance] =_1),[Rate])

Helper IV

thanks for your rep. However, I wanna create formulas in Power query. So is there any way to do it?

Announcements

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

Power BI Monthly Update - April 2024

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

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors