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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
malpani
Helper I
Helper I

New custom column to get the latest status of release lifecycle by comparing rows in the database

Hi, 

 

In my datasource (JIRA), I am getting data in following format. 

This datasource shows release data which goes through milestones from P1 to P10 and status of each milestone.

 

Unique KeyProduct NameRelease NameMilestoneStatus
Key1Product A24.xP1Approved
Key2Product A24.xP2Approved
Key3Product A24.xP3Approved
Key4Product A24.xP4Approved
Key5Product A24.xP5Approved
Key6Product A24.xP6Approved
Key7Product A24.xP7Approved
Key8Product A24.xP8Planned
Key9Product A24.xP9Planned
Key10Product A24.xP10Planned
Key11Product B24.xP1Approved
Key12Product B24.xP2Approved
Key13Product B24.xP3Approved
Key14Product B24.xP4Planned
Key15Product B24.xP5Planned
Key16Product B24.xP6Planned
Key17Product B24.xP7Planned
Key18Product B24.xP8Planned
Key19Product B24.xP9Planned
Key20Product B25.xP10Planned

 

I would like to get an additional column to get the latest lifecycle status of release meaning which latest milestone is Approved. 


Unique KeyProduct NameRelease NameMilestoneStatusLifecycle Status
Key1Product A24.xP1ApprovedP5 Approved
Key2Product A24.xP2ApprovedP5 Approved
Key3Product A24.xP3ApprovedP5 Approved
Key4Product A24.xP4ApprovedP5 Approved
Key5Product A24.xP5ApprovedP5 Approved
Key6Product A24.xP6ApprovedP5 Approved
Key7Product A24.xP7ApprovedP5 Approved
Key8Product A24.xP8PlannedP5 Approved
Key9Product A24.xP9PlannedP5 Approved
Key10Product A24.xP10PlannedP5 Approved
Key11Product B24.xP1ApprovedP3 Approved
Key12Product B24.xP2ApprovedP3 Approved
Key13Product B24.xP3ApprovedP3 Approved
Key14Product B24.xP4PlannedP3 Approved
Key15Product B24.xP5PlannedP3 Approved
Key16Product B24.xP6PlannedP3 Approved
Key17Product B24.xP7PlannedP3 Approved
Key18Product B24.xP8PlannedP3 Approved
Key19Product B24.xP9PlannedP3 Approved
Key20Product B25.xP10PlannedP3 Approved

 

 

 

1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

Thanks for the reply from @amitchandak , please allow me to provide another insight:

 

Hi @malpani ,

 

You can try formula like below:

Lifecycle Status =
VAR CurrentProduct = Releases[Product Name]
VAR CurrentRelease = Releases[Release Name]
VAR LatestApprovedMilestone =
    CALCULATE (
        MAX ( Releases[Milestone] ),
        FILTER (
            Releases,
            Releases[Product Name] = CurrentProduct
                && Releases[Release Name] = CurrentRelease
                && Releases[Status] = "Approved"
        )
    )
RETURN
    IF (
        ISBLANK ( LatestApprovedMilestone ),
        BLANK (),
        LatestApprovedMilestone & " Approved"
    )

vkongfanfmsft_0-1717124442414.png

Best Regards,
Adamk Kong

 

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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

The answer should be P7 (not P5) for Product A.  This calculated column formula works

Column = CALCULATE(MAX(Data[Milestone]),FILTER(Data,Data[Product Name]=EARLIER(Data[Product Name])&&Data[Status]="Approved"))

 

Ashish_Mathur_0-1717124949289.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-kongfanf-msft
Community Support
Community Support

Thanks for the reply from @amitchandak , please allow me to provide another insight:

 

Hi @malpani ,

 

You can try formula like below:

Lifecycle Status =
VAR CurrentProduct = Releases[Product Name]
VAR CurrentRelease = Releases[Release Name]
VAR LatestApprovedMilestone =
    CALCULATE (
        MAX ( Releases[Milestone] ),
        FILTER (
            Releases,
            Releases[Product Name] = CurrentProduct
                && Releases[Release Name] = CurrentRelease
                && Releases[Status] = "Approved"
        )
    )
RETURN
    IF (
        ISBLANK ( LatestApprovedMilestone ),
        BLANK (),
        LatestApprovedMilestone & " Approved"
    )

vkongfanfmsft_0-1717124442414.png

Best Regards,
Adamk Kong

 

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

amitchandak
Super User
Super User

@malpani , Create a new column

 

Stage = right([Milestone], Len([Milestone]) -1)

 

Then create a measure

final status =

var _max = maxx(filter(Table, [Product Name] = earlier([Product Name]) ), [Stage])

return

maxx(filter(Table, [Product Name] = earlier([Product Name]) && [Stage] =_max) , [Status])

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors