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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors