powerbipowerquerypowerbi-desktopm

Add aggregated column into the same table


I have a table in power query with the following columns:

I want to add another column which would sum monthly sales for each sales person. So this column would have many duplicated numbers.

enter image description here

I tried to created a new grouped table, and then to merge it with original table, but the power query didn't like the cyclic reference. Is there a way I have aggregated amount in the same table?

The table is constantly updated, so the monthly amount will be recalculated every time. Then I will use it the following way - if mothly sales of a person reach a certain level, then the day's amount is going to be processed a certain way.


Solution

  • You need a proper date column but the in absence of that, here is an easy way in PQ.

    Start:

    enter image description here

    Add column, extract, first 3
    enter image description here

    enter image description here

    Group by, sum and all:

    enter image description here

    Result

    enter image description here

    Then expand:

    enter image description here