Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm struggling how to identify the rows that have more data based on a column, in this case: Owner, if there is no Owner at all, show the row with no owner. PowerQuery is preferable, but if that is not possible, using PowerBI
Example:
| Color | State | Toy | Owner |
| Blue | MI | car | |
| Blue | MI | train | Snoopy |
| Yellow | AZ | ball | Charlie |
| Yellow | AZ | yoyo | |
| Red | CO | doll | |
| Red | CO | doll |
Desired result: No matter what Toy is it, report only the row which has an owner if it exists.
| Color | State | Toy | Owner |
| Blue | MI | train | Snoopy |
| Yellow | AZ | ball | Charlie |
| Red | CO | doll |
Solved! Go to Solution.
Hi @heriberto_mb,
The most straight forward method is through a Group By on Color and State.
Give this a go.
let
Source = Table.FromRows(
{
{"Blue", "MI", "car", null},
{"Blue", "MI", "train", "Snoopy"},
{"Yellow", "AZ", "ball", "Charlie"},
{"Yellow", "AZ", "yoyo", null},
{"Red", "CO", "doll", null},
{"Red", "CO", "doll", null}
}, type table [Color=text, State=text, Toy=text, Owner=text]
),
GroupRows = Table.Combine(
Table.Group( Source, {"Color", "State"}, {
{"data", each Table.FirstN( Table.Sort(_, {"Owner", 1}), 1),
type table [Color=text, State=text, Toy=text, Owner=text]}
})[data]
)
in
GroupRows
I hope this is helpful
Hi @heriberto_mb,
The most straight forward method is through a Group By on Color and State.
Give this a go.
let
Source = Table.FromRows(
{
{"Blue", "MI", "car", null},
{"Blue", "MI", "train", "Snoopy"},
{"Yellow", "AZ", "ball", "Charlie"},
{"Yellow", "AZ", "yoyo", null},
{"Red", "CO", "doll", null},
{"Red", "CO", "doll", null}
}, type table [Color=text, State=text, Toy=text, Owner=text]
),
GroupRows = Table.Combine(
Table.Group( Source, {"Color", "State"}, {
{"data", each Table.FirstN( Table.Sort(_, {"Owner", 1}), 1),
type table [Color=text, State=text, Toy=text, Owner=text]}
})[data]
)
in
GroupRows
I hope this is helpful
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!