Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
sixelapowerbi
Regular Visitor

Set the current phase in a process

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.

 

IDPhaseNumberStartEndActivePhaseCurrentPhase
0011DD.MM.YYYYDD.MM.YYYYNoNo
0012DD.MM.YYYY*TODAY*YesYes
0013DD.MM.YYYY*TODAY*YesNo
0014DD.MM.YYYYDD.MM.YYYYNoNo
0021DD.MM.YYYYDD.MM.YYYYNoNo
0022DD.MM.YYYYDD.MM.YYYYNoNo
0023DD.MM.YYYY*TODAY*YesYes
0024DD.MM.YYYY*TODAY*YesNo
0031DD.MM.YYYYDD.MM.YYYYNoNo
0032DD.MM.YYYYDD.MM.YYYYNoNo
0033DD.MM.YYYYDD.MM.YYYYNoNo
0034DD.MM.YYYYDD.MM.YYYYNoNo
0041DD.MM.YYYYDD.MM.YYYYNoNo
0042DD.MM.YYYYDD.MM.YYYYNoNo
0043DD.MM.YYYY*TODAY*YesYes
0044DD.MM.YYYYDD.MM.YYYYNoNo

 

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.

1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi,

to obtain this

serpiva64_0-1677064347661.png

- add a Today column

Date.From( DateTimeZone.FixedUtcNow())

- determine ActivePhase with a conditional column

serpiva64_1-1677064433434.png

 

- filtered rows

serpiva64_2-1677064467576.png

- grouped filtered table

serpiva64_3-1677064520444.png

- 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 

serpiva64_4-1677064729362.png

- 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!

 

 

 

View solution in original post

2 REPLIES 2
sixelapowerbi
Regular Visitor

It's works.

Thanks for the quick answer.

serpiva64
Solution Sage
Solution Sage

Hi,

to obtain this

serpiva64_0-1677064347661.png

- add a Today column

Date.From( DateTimeZone.FixedUtcNow())

- determine ActivePhase with a conditional column

serpiva64_1-1677064433434.png

 

- filtered rows

serpiva64_2-1677064467576.png

- grouped filtered table

serpiva64_3-1677064520444.png

- 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 

serpiva64_4-1677064729362.png

- 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!

 

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors