Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
Formula after I expand the tables:
= Table.ExpandTableColumn(#"Expanded Device", "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})
Picture to match formula:
Thanks!
Solved! Go to Solution.
You can try with step below
= Table.ExpandTableColumn( Table.TransformColumns(#"Expanded Device",{ "NetworkInterface", each Table.FirstN(_,1)}) , "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})
Even cleaner:
= Table.TransformColumns(#"Table or Last Step Name", {{"NetworkInterface", each Table.FirstValue(_)}})
--Nate
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
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!
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.
= Table.ExpandTableColumn( Table.TransformColumns(#"Expanded Device",{ "NetworkInterface", each Table.FirstN (Table.Sort(_,{{"sNetworkName", Order.Descending}}) ,1)}) , "NetworkInterface", {"sNetworkAddress", "sNetworkName"}, {"sNetworkAddress", "sNetworkName"})
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 19 | |
| 14 | |
| 11 | |
| 9 | |
| 8 |