Forum Discussion

Rookarumba's avatar
Rookarumba
Helper III
9 years ago
Solved

Get & Transform . How to write Cumulative Count with M language or within PowerQuery

Hi Folks,

 

I'm looking to do cumulative count within PowerQuery so i can use that particular column and Pivot it as a header.

 

Below in the sample Data before any queries.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I managed to merge Product & Category, Product ID & Product Description with " | " as the delimiter.
Then I created an extra column "Column Header" as the Header to Pivot as the Column Header for " Product ID & Product Description".
In excel the formula will be like =COUNTIF(M$4:M4,M4) to get a cumulative count for "Product & Category"
Column M is "Product | Category "

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'm hoping someone can help me out with the formula cumulative count within PowerQuery, using "Product | Category" as the criteria.

2 Replies

    • Rookarumba's avatar
      Rookarumba
      Helper III

      Yes, This work like a charm :) I guess i didnt understand the grouping function as i only Group based on 1 of column :)