This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I have a dataset where the output shows employees and whether a reocord is locked or not. Sme employees have both locked and not locked, ultimately showing 2 different rows for each. I need to exclude any employee who has a no (even if they also have a yes). I have included a screen shot, those highlighted in Yellow need to be excluded. I can't remove duplicates as it doesnt remove in any order, i cant remove Yes for obvious reasons and removing no still leaves those yes's behind which need to be excluded.
An help would be gratefully received.
Thanks
Solved! Go to Solution.
Hi @PamWren, check this:
Before
After
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bY85DoAwDAT/4jqFE5/5BD2KUlJT8H8JCkgMottdzVhya2AZhRgSrNsBPTVgRje/hmV/9wfwrKwWhoyoUv6G+0SpVbkGwAQJPwa5TWP0AYQcRZpOiPEf+cv9BA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"EE ID" = _t, Locked = _t]),
GroupedRows = Table.Group(Source, {"EE ID"}, {{"All", each _, type table}, {"FilterHelper", each if List.ContainsAll([Locked], {"Yes", "No"}) then 0 else 1, Int64.Type}}),
FilteredRows = Table.SelectRows(GroupedRows, each ([FilterHelper] = 1)),
Combined = Table.Combine(FilteredRows[All])
in
Combined
Hi @PamWren, check this:
Before
After
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bY85DoAwDAT/4jqFE5/5BD2KUlJT8H8JCkgMottdzVhya2AZhRgSrNsBPTVgRje/hmV/9wfwrKwWhoyoUv6G+0SpVbkGwAQJPwa5TWP0AYQcRZpOiPEf+cv9BA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"EE ID" = _t, Locked = _t]),
GroupedRows = Table.Group(Source, {"EE ID"}, {{"All", each _, type table}, {"FilterHelper", each if List.ContainsAll([Locked], {"Yes", "No"}) then 0 else 1, Int64.Type}}),
FilteredRows = Table.SelectRows(GroupedRows, each ([FilterHelper] = 1)),
Combined = Table.Combine(FilteredRows[All])
in
Combined
Thanks for your help - I actually found a fix myself over the weekend which worked beautifully. But again thankyou.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.