Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a table of quiz submissions as show below and I need to discard the student records with Incomplete status (#5) if there is already a record with Submitted status (#4)
How can I do this in Power Query ?
Solved! Go to Solution.
Hello !
you need create in Power Query table with name "Result_Table" and List with name "Submited_list"
code for its items bellow.
table with name "Base_Table" - it is your table from topic start
Submited_list
let
Source = Base_Table,
#"Filtered Rows" = Table.SelectRows(Source, each ([Status] = "Submited")),
Custom1 = #"Filtered Rows"[Name]
in
Custom1
Result_Table
let
Source = Base_Table,
#"Added Custom1" = Table.AddColumn(Source, "Completed_List", each List.Contains(Submited_list, [Name])),
#"Added Conditional Column" = Table.AddColumn(#"Added Custom1", "check", each if [Completed_List] = true and [Status]<>"Submited" then 0 else 1),
#"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([check] = 1)),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"SN", "Name", "Status"})
in
#"Removed Other Columns"
I hope it will help you 🙂
Best Regards !
If I answered at your question please mark topic as resolved 🙂
Hello !
you need create in Power Query table with name "Result_Table" and List with name "Submited_list"
code for its items bellow.
table with name "Base_Table" - it is your table from topic start
Submited_list
let
Source = Base_Table,
#"Filtered Rows" = Table.SelectRows(Source, each ([Status] = "Submited")),
Custom1 = #"Filtered Rows"[Name]
in
Custom1
Result_Table
let
Source = Base_Table,
#"Added Custom1" = Table.AddColumn(Source, "Completed_List", each List.Contains(Submited_list, [Name])),
#"Added Conditional Column" = Table.AddColumn(#"Added Custom1", "check", each if [Completed_List] = true and [Status]<>"Submited" then 0 else 1),
#"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([check] = 1)),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"SN", "Name", "Status"})
in
#"Removed Other Columns"
I hope it will help you 🙂
Best Regards !
Thanks for the solution. The List.Contains( ) is the look up function that I was looking for !
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |