Forum Discussion

Jammer8888's avatar
Jammer8888
Frequent Visitor
9 years ago
Solved

Creating a cumulative column breaking on another column - help !

 

Hi,

 

I am new to Power BI and I am looking for a very simple way to bring back the 'Cume' column (shown in the example below) into my dataset so I can filter on the Cume = '1' to get a unique value. I know that I will have to sort the data on 'Colour' in order to get the column in the right order first but after that I am at a loss. I don't want to group the data or anything else - just simply create the cumulative value based on the count breaking on the Colour Column. 

 

ColourCountCume
Red11
Red12
Red13
Blue11
Green11
Yellow11
Yellow12
Yellow13
Orange11


I am sure there is a very simple way to do this for a beginner but I have not been able to figure it out yet - any help would be greatly appreciated. Many thanks.

  • Jammer8888

     

    Hi, a way to solve this:

     

    in Edit Query:

     

    Add a Index Column --Close & Apply

     

    After this:

     

    Create a new column 

     

    Cume=RANKX(FILTER(Table1,Table1[Colour]=EARLIER(Table1[Colour])),Table1[Index],,ASC)

     

    Regards

     

    Victor

    Lima - Peru

     

2 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    Jammer8888

     

    Hi, a way to solve this:

     

    in Edit Query:

     

    Add a Index Column --Close & Apply

     

    After this:

     

    Create a new column 

     

    Cume=RANKX(FILTER(Table1,Table1[Colour]=EARLIER(Table1[Colour])),Table1[Index],,ASC)

     

    Regards

     

    Victor

    Lima - Peru

     

    • Jammer8888's avatar
      Jammer8888
      Frequent Visitor

      That is great Victor - a simple and elegant solution. Thank you very much for your help on this.

       

      Chris.