Forum Discussion

AGo's avatar
AGo
Icon for Post Patron rankPost Patron
5 years ago

Power query add column with count on filtered previous rows

Hi, I'm able to do this in DAX but I need this in Power Query:

I've got a column with different values usually repeating, eg:

 

SourceColumnExpected Column Added

Color

0
Size0
Model0
 0
Color1
Size1
Model1
Variant1
 1
Color2
Size2
Model2
Type2

On its right a column with the proper value, but ignore that, because I only need to add a column that counts how many blank values are there in the first column before that row. It's like that blank value determines that attributes of another new product are going to be scanned.

 

Thanks in advance

3 Replies

  • AGo , Not clear with this -" I will group my different product attributes and unpivot"

     

    You will unpivot in power query, so that you will different column and then you count blank in DAX measures?

     

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

    • AGo's avatar
      AGo
      Icon for Post Patron rankPost Patron

      I edited my post. The "group-by part" is not needed.

      Thanks

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support

    Unfortunately, I've tried for a long time and still can't use power query to solve this problem. Maybe you can consider DAX.