cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CKNIGHT
Helper I
Helper I

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 @CKNIGHT ,

 

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 @CKNIGHT ,

 

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 @CKNIGHT ,

 

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

v-kkf-msft
Community Support
Community Support

Hi @CKNIGHT ,

 

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

Helpful resources

Announcements
Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Power BI Womens Summit 2021 768 x460.jpg

Interviews, learning sessions, allies, and more!

#PowerBIWomenSummit

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!