Forum Discussion

HugoCExtA's avatar
HugoCExtA
Regular Visitor
9 years ago
Solved

Group by specific condition

Hello,

 

I have a table that I'd like to group by with a specific condition, the condition is : each time there is a 1 in a colum I'd like to group until there is another 1 in the same column. (Not sure it is very clear so I made a picture of what I'd like).

 

 

I'm not even sure it is possible with Power BI, but still any advice would be nice.

 

Thanks in advance.

  • In the query editor just add an index column first. Then multiply that with Type. Replace 0 by null and fill down values.

    That will allocate the same number to each row in the group but a different number per group.

2 Replies

  • ImkeF's avatar
    ImkeF
    Icon for Community Champion rankCommunity Champion

    In the query editor just add an index column first. Then multiply that with Type. Replace 0 by null and fill down values.

    That will allocate the same number to each row in the group but a different number per group.

    • HugoCExtA's avatar
      HugoCExtA
      Regular Visitor

      Thanks, it worked ! Did not know the fill function :)