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.
Hello,
I am stuck on something for many days that I think should be fairly easy and any ideas can help!
I have many different statuses (over 15 different, I only show few here) and I need to sort so that the correct status is the one row that is left. If the status is completed, the whole id and all rows shold be filtered away.
Any idea on how I can sort the ids compared to the statuses?
If statement or case? I am fairly new to dax and power bi so I am having a hard time finding the correct way of thinking.
This is the example data
| Id | status |
| 1 | started |
| 1 | processing |
| 1 | ready |
| 1 | completed |
| 2 | started |
| 2 | processing |
| 3 | started |
| 3 | processing |
| 3 | ready |
And this is the result I want:
| id | status |
| 2 | processing |
| 3 | ready |
let
Source = Table.FromColumns({
{1,1,1,1,2,2,3,3,3},
{"started","Processing","ready","completed","started","Processing","started","Processing","ready"}
},
type table[id=Int64.Type, status=text]
),
//Group by ID and return the "Last" item in the status column
#"Grouped Rows" = Table.Group(Source, {"id"}, {
{"status", each List.Last([status]), type text}}),
//Remove any rows where last status is "completed"
#"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each ([status] <> "completed"))
in
#"Filtered Rows"
Check out the May 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 |