Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello everyone,
I need help creating a new column in Power Query that would define the "Current Phase" of each asset in my process.
Here is an example.
| ID | PhaseNumber | Start | End | ActivePhase | CurrentPhase |
| 001 | 1 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 001 | 2 | DD.MM.YYYY | *TODAY* | Yes | Yes |
| 001 | 3 | DD.MM.YYYY | *TODAY* | Yes | No |
| 001 | 4 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 002 | 1 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 002 | 2 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 002 | 3 | DD.MM.YYYY | *TODAY* | Yes | Yes |
| 002 | 4 | DD.MM.YYYY | *TODAY* | Yes | No |
| 003 | 1 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 003 | 2 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 003 | 3 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 003 | 4 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 004 | 1 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 004 | 2 | DD.MM.YYYY | DD.MM.YYYY | No | No |
| 004 | 3 | DD.MM.YYYY | *TODAY* | Yes | Yes |
| 004 | 4 | DD.MM.YYYY | DD.MM.YYYY | No | No |
Currently my "ActivePhase" column looks if the "End" date is *TODAY*, so "Yes", if not "No".
I can have several active phases but I can only have at most one "CurrentPhase".
So I would like my "Current Phase" column to take the active phase which has the smallest 'PhaseNumber' for each ID.
Do you have any ideas please.
Solved! Go to Solution.
Hi,
to obtain this
- add a Today column
Date.From( DateTimeZone.FixedUtcNow())
- determine ActivePhase with a conditional column
- filtered rows
- grouped filtered table
- from a previous step i get unfiltered table
- merge unfiltered with grouped
= Table.NestedJoin(Custom1, {"ID"}, MinStart, {"ID"}, "Custom1", JoinKind.LeftOuter)
(you can merge the unfiltered with itself then change the second table)
- expanded
- then add a conditional column for CurrentPhase
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!
It's works.
Thanks for the quick answer.
Hi,
to obtain this
- add a Today column
Date.From( DateTimeZone.FixedUtcNow())
- determine ActivePhase with a conditional column
- filtered rows
- grouped filtered table
- from a previous step i get unfiltered table
- merge unfiltered with grouped
= Table.NestedJoin(Custom1, {"ID"}, MinStart, {"ID"}, "Custom1", JoinKind.LeftOuter)
(you can merge the unfiltered with itself then change the second table)
- expanded
- then add a conditional column for CurrentPhase
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |