powerbipowerquery

How to join columns from different tables and insert a calculated column in PowerBI / Power Query


I have 2 tables in Power BI: ITEMS and SUB_ITEMS.

Each action in SUB_ITEMS has a percentage of completion:

In this case, the total progress of the main action (ITEMS) should be 28%:

I created a calculated table that gives me the percentage for each action (eg. 20%).

The percentage for each sub action is already in the table SUB_ITEMS (eg. 100%, 0%, 0%, 20%, 20%).

I need to put the column ITEM_NUMER, from ITEMS, together with SUB_ITEM_NUMBER into a new table, in order to apply the percentage from ITEMS (eg. 20%) over each percentage from the SUB_ITEMS (eg. 100%, 0%, 0%, 20%, 20%).

I don't know how to apply this percentage, once that the measure created to bring the 20% percentage is not available in Power Query, only in Power BI.

I'd appreciate your help.

Thanks in advance.


Solution

  • Assuming your data looks like this in Powerquery

    enter image description here

    Then in the ITEMS table, add column .. custom column .. with formula

     = [Percent]*List.Sum(SUB_ITEMS[Percent])