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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How do I only expand the first row of a table?

Hi,

 

I only want to return the first result from each table from each row. How do I do this? Some tables only ahve 1 item, others have 4 or more, the first is always the one I want.

1.png

Formula after I expand the tables:

 

 

 

= Table.ExpandTableColumn(#"Expanded Device", "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})

 

 

 

Picture to match formula:

2.png

Thanks!

1 ACCEPTED SOLUTION
Jakinta
Solution Sage
Solution Sage

You can try with step below

= Table.ExpandTableColumn( Table.TransformColumns(#"Expanded Device",{ "NetworkInterface", each Table.FirstN(_,1)}) , "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})

 

 

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Several of your solutions worked, but I went with @Jakinta , thanks all!

Anonymous
Not applicable

Even cleaner:

 

= Table.TransformColumns(#"Table or Last Step Name", {{"NetworkInterface", each Table.FirstValue(_)}})


--Nate

Anonymous
Not applicable

If you are saying you want the first value from the first cow of each table, it's Table.AddColumn(#"Name of Your Last Step or Table Name", "First", each Table.FirstValue([NetworkInterface]))

 

--Nate

Jakinta
Solution Sage
Solution Sage

You can try with step below

= Table.ExpandTableColumn( Table.TransformColumns(#"Expanded Device",{ "NetworkInterface", each Table.FirstN(_,1)}) , "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})

 

 

Great solution, just what I needed!

Anonymous
Not applicable

How would you sort this in decending order BEFORE getting the first row? Turns out the data needs to be sorted first to get the expected first item.

Anonymous
Not applicable

@Jakinta "sNetworkName" is the one I'd wanted sorted.

 

 

= Table.ExpandTableColumn( Table.TransformColumns(#"Expanded Device",{ "NetworkInterface", each Table.FirstN (Table.Sort(_,{{"sNetworkName", Order.Descending}}) ,1)}) , "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})

 

mahoneypat
Microsoft Employee
Microsoft Employee

You can add a custom column with this formula to keep just the top record (row) of your tables.

 

= Table.FirstN([NetworkInterface],1)

 or

= [NetworkInterface]{0}

 

You can then delete the original column and expand the new one.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors