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
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
Super User
Super User

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
Super User
Super User

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

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.