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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Advanced Filtering to remove unmet measure data split in several rows but the same ID

Hello! My Goal: Capture the rows shown below where the PCR_ID has at least one non NV value entered into the columns "PulseOximetry" and "respiratory_rate" so I can identify if a healthcare measure was met.

 

Since one PCR_ID can have several Vital Signs done in one call, I need to count the ones where both where done but not the ones where just one is done and not the other. The EMT can log these in different row so that is my problem- I need to filter out the rows that do not have both PULSEOXIMETRY and Respiratory filled in but on some rows with the same PCR_ID they are logged on different lines.

EX: Lines 239 - measure met = keep

Lines 245 - Measure not met = Filter

Lines 13 and 14 = Measure met between two rows - Keep

CKNIGHT_0-1627074152281.png

CKNIGHT_1-1627074337968.png

 

2 ACCEPTED SOLUTIONS
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try the following formula:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsrRQ0lEyMgESiYlKsTrRSoYGBkCOIUg4KQksYmkJUmKAEPALszU3B/GNTYFEcjKSPiMjhAhcGdiOlBSEYXAZqCCcD2ekpirFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Pulse_Oximetry = _t, Respiratory_Rate = _t, PCR_ID = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Pulse_Oximetry", type text}, {"Respiratory_Rate", type text}, {"PCR_ID", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"NV Table" = Table.FindText(#"Added Index","NV"),
    #"Difference" = List.Difference(#"Added Index"[Index],#"NV Table"[Index]),
    #"Contain Index" = Table.SelectRows(#"Added Index",each List.Contains(#"Difference",[Index])),
    #"Contain PCRID" = Table.SelectRows(#"Added Index",each List.Contains(#"Contain Index"[PCR_ID],[PCR_ID]))
in
    #"Contain PCRID"

vkkfmsft_0-1627276965023.png

 


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try the following formula:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsrRQ0lEyMgESiYlKsTrRSoYGBkCOIUg4KQksYmkJUmKAEPALszU3B/GNTYFEcjKSPiMjhAhcGdiOlBSEYXAZqCCcD2ekpirFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Pulse_Oximetry = _t, Respiratory_Rate = _t, PCR_ID = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Pulse_Oximetry", type text}, {"Respiratory_Rate", type text}, {"PCR_ID", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"NV Table" = Table.FindText(#"Added Index","NV"),
    #"Difference" = List.Difference(#"Added Index"[Index],#"NV Table"[Index]),
    #"Contain Index" = Table.SelectRows(#"Added Index",each List.Contains(#"Difference",[Index])),
    #"Contain PCRID" = Table.SelectRows(#"Added Index",each List.Contains(#"Contain Index"[PCR_ID],[PCR_ID]))
in
    #"Contain PCRID"

vkkfmsft_0-1627276965023.png

 


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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