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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
PARAG_26
New Member

first n values in

BRCODECIF

12211
5182
5233
5254
12215
47566
5187
5188
5189
52510
52511
52512
52513
122114
122115
475616
47517
475618
475619

In the above list i want dynamically to select first two cell from each distinct value in brcode like

brcode    cif

1221        1

1221        5

518          2

518          7.

I tried List.FirstN after grouping but it is giving error. Please hep

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

NewStep=Table.Combine(Table.Group(PreviousStepName,"BRCODE",{"n",each Table.FirstN(_,2)})[n])

View solution in original post

2 REPLIES 2
PARAG_26
New Member

Hi Daniel... it worked. Many thanks for your accurate and prompt reply

wdx223_Daniel
Community Champion
Community Champion

NewStep=Table.Combine(Table.Group(PreviousStepName,"BRCODE",{"n",each Table.FirstN(_,2)})[n])

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.

Top Solution Authors