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
Ericwhv
Helper II
Helper II

Table data link up question

Hi All


First of all, i do really appreciate your time on reading this.

 

I got a problem on Power Query(power BI) about the data linking,showing.

First of all, i have two Table,
the first are shipment details table

HB_REFERENCEWeightLaneCargo_Ready_DateRouteLeg
H13458828100BLRHYD03/05/2023 10:30FirstLeg
H1345882950BLRHYD03/05/2023 11:00FirstLeg
H13458908200BLRHYD04/05/2023 22:00FirstLeg
H13458910100BLRHYD04/05/2023 22:00FirstLeg
H13458968300BLRHYD04/05/2023 23:30FirstLeg
H13459055200BLRHYD06/05/2023 22:00FirstLeg
H13459056300BLRHYD06/05/2023 23:22FirstLeg
H13459316500BLRHYD12/05/2023 17:45FirstLeg
H13459317200BLRHYD12/05/2023 17:45LastLeg

 

the second are the truck schedule table

 

LaneDepartureArrival
BLRHYD01-May02-May
BLRHYD02-May03-May
BLRHYD03-May04-May
BLRHYD04-May05-May
BLRHYD07-May08-May
BLRHYD08-May09-May
BLRHYD09-May10-May
BLRHYD10-May11-May
BLRHYD11-May12-May
BLRHYD14-May15-May

 

the result i want to achieve as below

LaneBKDETAWeightExplaination
BLRHYD01-May02-May0No cargo is ready
BLRHYD02-May03-May0No cargo is ready
BLRHYD03-May04-May150Cargo is ready 100 + 50
BLRHYD04-May05-May600cargo is ready 200+100+300
BLRHYD07-May08-May50006/May Cargo is ready roll it in this row 200+300
BLRHYD08-May09-May0No cargo is ready
BLRHYD09-May10-May0No cargo is ready
BLRHYD10-May11-May0No cargo is ready
BLRHYD11-May12-May0No cargo is ready
BLRHYD14-May15-May70012/May cargo is ready roll it in this row 500 + 200

 

not sure if that is possible?

if the cargo ready date is same as BKD date, then, add all of the weight and put it on that row
if the cargo ready date which do not have a schedule, it will push to the next first available schedule.

 

Thank you everyone!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ericwhv ,

 

The solution is simple, but it's a bit complicated to tell, and I'll try to make it clear.

1.Create a custom column in your truck schedule table.

vstephenmsft_0-1687143133405.png

2.Use the Merge Queries feature to join the two tables based on the Lane column.

vstephenmsft_2-1687143318152.png

3.Add a custom column in the merged table to filter out the rows that match your needs.

vstephenmsft_3-1687143413869.png

vstephenmsft_4-1687143433977.png

4.Use the Group By feature to group the data by Lane and Departure columns, and use the Sum aggregation function to calculate the total weight.

vstephenmsft_5-1687143753652.png

5.Finally, duplicate the truck schedule table, note that it is not a reference, and then merge it inside based on the Lane column and the Departure column.

vstephenmsft_7-1687143845457.png

vstephenmsft_8-1687143894803.png

6.This is the expected result.

vstephenmsft_6-1687143770586.png

 

Best Regards,

Stephen Tao

 

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

4 REPLIES 4
Ericwhv
Helper II
Helper II

thank you Stephen!
it could work

but when i create a customs column it come up with below error

[Expression.Error] We cannot convert the value null to type Logical.

i guess it is because of some schedule do not have any cargo ready like below, then, these row become am "Error" could you mind to tell me how get rid of these blank, i prefer to keep it, thx!

 

Ericwhv_0-1687188205382.png

 




at the end, i cannot group it together, thank you.

Anonymous
Not applicable

Hi @Ericwhv ,

 

The error message you are seeing is because the value in the column you are referencing is null, and Power BI is trying to convert it to a logical value To get rid of the blank rows, you can filter them out using the filter feature in Power Query. However, if you prefer to keep the blank rows, you can try using replace error/replace value to return BLANK when a meaningful value cannot be returned

 

Best Regards,

Stephen Tao

 

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

Thank you Stephen
Yes, literally, there is some "Truck Schedule" are blank with no cargo can be move, so, it got an "Error"
I just grab these blank schdule out first, anyway, all good now, thank you so much for your help and time!!

Anonymous
Not applicable

Hi @Ericwhv ,

 

The solution is simple, but it's a bit complicated to tell, and I'll try to make it clear.

1.Create a custom column in your truck schedule table.

vstephenmsft_0-1687143133405.png

2.Use the Merge Queries feature to join the two tables based on the Lane column.

vstephenmsft_2-1687143318152.png

3.Add a custom column in the merged table to filter out the rows that match your needs.

vstephenmsft_3-1687143413869.png

vstephenmsft_4-1687143433977.png

4.Use the Group By feature to group the data by Lane and Departure columns, and use the Sum aggregation function to calculate the total weight.

vstephenmsft_5-1687143753652.png

5.Finally, duplicate the truck schedule table, note that it is not a reference, and then merge it inside based on the Lane column and the Departure column.

vstephenmsft_7-1687143845457.png

vstephenmsft_8-1687143894803.png

6.This is the expected result.

vstephenmsft_6-1687143770586.png

 

Best Regards,

Stephen Tao

 

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

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.