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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Grouping sets of data into dynamic collections

Hello, could you please help me with a project?

 

I am attempting to group sets of data by a key column called "product". 

 

At my job we make about 10-20 different products on a monthly basis. These products repeat monthly so that at the end of the year we would have created 10-20 "campaigns" of one particular product. While creating one product type, we make several "batches" of this product that each usually have a unique weight. So at the end of one campaign, we may have 15 batches of product A for the month that each weighs 180 lbs.

 

I would like to be able to create groups to analyze a particular product's 10 campaigns for the past year and compare different attributes of each campaign. Things like the average weight and the percentage of batches that did not meet our quality standards.

 

Is it possible to create a measure that does this? 

 

Please see the snippet below for an example of going from product "3662" to product "3762". The last column denotes the campaign and how I think they should be seperated.

 

tadams103_0-1629114815439.png

 

UnitBatch NumberProductCODETimeWeightGradeCampaign ID 
UNIT8BATCH_8109623662 6/1/2021 0:04195GOOD1
UNIT8BATCH_8109643662 6/1/2021 2:51195GOOD1
UNIT8BATCH_8109653662 6/1/2021 5:33195GOOD1
UNIT8BATCH_8109663662 6/1/2021 8:20195GOOD1
UNIT8BATCH_8109673662 6/1/2021 11:10195GOOD1
UNIT8BATCH_8109683662 6/1/2021195GOOD1
UNIT8BATCH_8109693662 6/1/2021 16:43195GOOD1
UNIT8BATCH_8109703662B6/1/2021 19:28195GOOD1
UNIT8BATCH_8109713662 6/1/2021 22:11195GOOD1
UNIT8BATCH_8109723662 6/2/2021 0:00124GOOD1
UNIT8BATCH_8109723662 6/2/2021 0:55195GOOD1
UNIT8BATCH_8109633762E6/2/2021 2:06115BAD2
UNIT8BATCH_8109733762 6/2/2021100GOOD2
UNIT8BATCH_8109743762 6/2/2021 6:15195GOOD2
UNIT8BATCH_8109753762 6/2/2021 8:52195GOOD2
UNIT8BATCH_8109763762 6/2/2021 11:30195GOOD2
UNIT8BATCH_8109773762 6/2/2021 14:09195GOOD2
UNIT8BATCH_8109733762 6/2/2021 15:24195GOOD2
UNIT8BATCH_8109783762 6/2/2021 17:10128GOOD2

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

If you mean to aggregate records with specific categories or groups, you can try to use iterator functions or calculate functions with filters.

measure =
CALCULATE (
    AVERAGE ( Table[Weight] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Unit] ),
    VALUES ( Table[Product] )
)

Regards,
Xiaoxin Sheng

lbendlin
Super User
Super User

@Anonymous You may want to enable the Q&A and Insights options in your dataset, and then see if the Insights come up with meaningful groupings. Some Power BI visuals also offer a "Find groups" function. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors