Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
| Unit | Batch Number | Product | CODE | Time | Weight | Grade | Campaign ID |
| UNIT8 | BATCH_810962 | 3662 | 6/1/2021 0:04 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810964 | 3662 | 6/1/2021 2:51 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810965 | 3662 | 6/1/2021 5:33 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810966 | 3662 | 6/1/2021 8:20 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810967 | 3662 | 6/1/2021 11:10 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810968 | 3662 | 6/1/2021 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810969 | 3662 | 6/1/2021 16:43 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810970 | 3662 | B | 6/1/2021 19:28 | 195 | GOOD | 1 |
| UNIT8 | BATCH_810971 | 3662 | 6/1/2021 22:11 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810972 | 3662 | 6/2/2021 0:00 | 124 | GOOD | 1 | |
| UNIT8 | BATCH_810972 | 3662 | 6/2/2021 0:55 | 195 | GOOD | 1 | |
| UNIT8 | BATCH_810963 | 3762 | E | 6/2/2021 2:06 | 115 | BAD | 2 |
| UNIT8 | BATCH_810973 | 3762 | 6/2/2021 | 100 | GOOD | 2 | |
| UNIT8 | BATCH_810974 | 3762 | 6/2/2021 6:15 | 195 | GOOD | 2 | |
| UNIT8 | BATCH_810975 | 3762 | 6/2/2021 8:52 | 195 | GOOD | 2 | |
| UNIT8 | BATCH_810976 | 3762 | 6/2/2021 11:30 | 195 | GOOD | 2 | |
| UNIT8 | BATCH_810977 | 3762 | 6/2/2021 14:09 | 195 | GOOD | 2 | |
| UNIT8 | BATCH_810973 | 3762 | 6/2/2021 15:24 | 195 | GOOD | 2 | |
| UNIT8 | BATCH_810978 | 3762 | 6/2/2021 17:10 | 128 | GOOD | 2 |
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
@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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!