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
Greetings, I have a table as such. These informations are received to the database but from different devices that do not have access ot the same informations. As a result, one of the device cannot accurately tell which user did the job, leaving it to a UserId of 0.
I would like, if a line with a userID value is at "0" to check if another line with the same "Piece" number exist with a value different than 0 and to replace said 0 with the UserID found. If no other number is found, to keep it at 0.
Solved! Go to Solution.
You can try something like this. Note I'm using a simple example.
Do "Group By" on the Piece column, Choose "All Rows" and transform the result, like so.
let
Source = Table.FromColumns(
{
{"A" .. "H"},
{123 .. 127, 0, 0, 128},
{546038 .. 546042, 546042, 546042, 546043}
},
{"Column1", "UserId", "Piece"}
),
GroupRows = Table.Group(
Source,
{"Piece"},
{{"t", each Table.TransformColumns(_, {"UserId", (x) => List.Max(_[UserId])})}}
),
ExpandAll = Table.Combine(GroupRows[t])
in
ExpandAll
I hope this is helpful
You can try something like this. Note I'm using a simple example.
Do "Group By" on the Piece column, Choose "All Rows" and transform the result, like so.
let
Source = Table.FromColumns(
{
{"A" .. "H"},
{123 .. 127, 0, 0, 128},
{546038 .. 546042, 546042, 546042, 546043}
},
{"Column1", "UserId", "Piece"}
),
GroupRows = Table.Group(
Source,
{"Piece"},
{{"t", each Table.TransformColumns(_, {"UserId", (x) => List.Max(_[UserId])})}}
),
ExpandAll = Table.Combine(GroupRows[t])
in
ExpandAll
I hope this is helpful
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 |
|---|---|
| 8 | |
| 7 | |
| 7 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 19 | |
| 14 | |
| 12 | |
| 12 | |
| 9 |