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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BQH15
Regular Visitor

How to calculate current step by checking previous step status?

Hello,

 

How would I get Power BI to show the current step of an order number?

 

Ideally the formula would group order number and look for the first step where status is "In Progress". ( Needs to check step A status first, then b, lastly c)

BQH15_2-1655927973975.png

The yellow column would be the needed result.

 

1 ACCEPTED SOLUTION
ManguilibeKAO
Resolver I
Resolver I

Hi BQH15,

Here's a solution:

a) Create a calculcated column Rank in the table, with the formula:

Rank = SWITCH(TRUE(),
[Step]="a",1,
[Step]="b",2,
[Step]="c",3
)

b) Create a calculated column in the table with the formula:


Current Step =
Var p = 'Feuil1'[Order Number]
Var t = FILTER('Feuil1',[Order Number]=p && [Status]="In Progress")
Var r = minX(t,[Rank])
Var s=FILTER(t,[Rank]=r && [Order Number]=p)
return MAXX(s,[Step])

 

Note that Feuil1 is the name of the table containing the data.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Manguilibe KAO

View solution in original post

2 REPLIES 2
ManguilibeKAO
Resolver I
Resolver I

Hi BQH15,

Here's a solution:

a) Create a calculcated column Rank in the table, with the formula:

Rank = SWITCH(TRUE(),
[Step]="a",1,
[Step]="b",2,
[Step]="c",3
)

b) Create a calculated column in the table with the formula:


Current Step =
Var p = 'Feuil1'[Order Number]
Var t = FILTER('Feuil1',[Order Number]=p && [Status]="In Progress")
Var r = minX(t,[Rank])
Var s=FILTER(t,[Rank]=r && [Order Number]=p)
return MAXX(s,[Step])

 

Note that Feuil1 is the name of the table containing the data.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Manguilibe KAO

This worked perfectly, thank you!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.