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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
weasel_girl
New Member

Summarize but only first value

I'm trying to summarize some data, but only want to keep the first instance of one of the categories. 

 

Data example 'Shops' here: 

 

ProductShop typeShop category
Bread rollsSupermarketBig store
Bread rollsBakeryLittle store
Bread rollsFreezer shopLittle store
VodkaSupermarketBig store
ParacetamolSupermarketBig store
ParacetamolPharmacyLittle store
TomatoesFarmerLittle store

 

Shop category is a calculated column based on Shop type. 

 

I'd want the summarized output to be:

ProductMain category
Bread rollsBig store
VodkaBig store
ParacetamolBig store
TomatoesLittle store

 

Is there a way of doing this in SUMMARIZE? 

 

At the moment my summarize command is:

ShopSummary = SUMMARIZE('Shops','Shops'[Product],'Shops'[Main Category]) 
but (understandably) I am getting error messages about duplicate values. 
 
Any advice greatly appreciated. 
1 REPLY 1
vicky_
Super User
Super User

Depending on why you need to summarize, you might not need to use a calculation for it: 

vicky__0-1689032785343.png

If you do need to create a summary, you can consider using something like 

Summarized = SUMMARIZE('Table', 'Table'[Product], "First Category", CALCULATE(MIN('Table'[Shop category]))

Just a note: the MIN takes the first product alphabetically. If you have some index in your raw data, it's best that you use that in the calculation.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.