Forum Discussion
Data Modeling Power Query, Operations between rows
- Anonymous7 years ago
You can use an index column starting at zero with this code for a new column:
try List.Sum( List.Range( #"Added Index"[Total Sales], [Index]-1, 1 ) ) otherwise 0For your other question, you can group by those columns and get a distinct count. It may not be your ideal solution, but it's at least a starting point.
I was trying the method to solve the second question, and the following occurred to me:
I did it with a VLOOKUP, looking for the value of the "SKU" column, and returning the value of the "index" column, those values that are different is because that SKU value appeared previously. My problem is that the VLOOKUP, covers the whole range and I want it to cover only the range that covers "CARGA & PAL", that is to say that it only searches in the repeated values of "CARGA & PAL", as if it were a VLOOKUP with variable range, it is possible do it in POWER QUERY?
Finding a value between a range of other values has been much easier using DAX, in my experience.
Any chance you can upload some sample data?