Forum Discussion
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:
| SourceColumn | Expected Column Added |
Color | 0 |
| Size | 0 |
| Model | 0 |
| 0 | |
| Color | 1 |
| Size | 1 |
| Model | 1 |
| Variant | 1 |
| 1 | |
| Color | 2 |
| Size | 2 |
| Model | 2 |
| Type | 2 |
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
- amitchandak
Super User
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
Post Patron
I edited my post. The "group-by part" is not needed.
Thanks
- V-lianl-msft
Community 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.