Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Grouping by only sequential column values

Hello, 

 

I have a dataset that I would like to create different groups of data by collecting data based on column values in one main column but only while those values repeat without skipping a cell. Once the pattern is broken if the same value is seen again I would like for the grouping to restart.

 

For example:

 

Let's say I work for a fruit collecting company that only collects one type of fruit at a time in baskets that can hold 1000 fruit. We often switch what type of fruit we collect at random times and dates but we still only collect that one type of fruit.  We call these first 2 days of collecting apples "campaign #1" and the second time we begin collecting apples on 1/4/2021 we call that "campaign #2".

 

DateBasket #FruitNumber Of Fruits Collected
1/1/20211apple1000
1/1/20212apple1000
1/2/20213apple800
1/2/20214orange200
1/4/20215apple

1000

 

How could I group this data into campaigns using PowerBI?

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

 

all measures are in the sample pbix file.

 

Picture2.png

 

https://www.dropbox.com/s/fx9e7eh0nujgjtx/tadams.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi this is very close to the solution I need but I have run into some errors. Firstly, the actual data I am trying to use contains letters and numbers instead of just letters like the words "apple" and "orange". Secondly, I would like to count campaigns for the other "fruit" being made as well. So in this case this would be campaign number one for oranges. I would also like to count the number of baskets within the campaign. with another column titled "basket number this campaign" that resets after each campaign.

 

Could you please help me with this?

Hi, @Anonymous 

Thank you for your feedback.

Please share your sample pbix file, with some pictures of how your desired outcome looks like, then I can try to have a look into it.

Thank you.

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.