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
Cydevos
Frequent Visitor

Get latest not null value for similar row with condition

Hi,

 

I would like to get the latest not null value of a column with some condition
Here is an example of my database

 

nametypeexecutionresultticketdatejob_id
aaaOOBEInternalPass 01/01/20001
bbbOOBEInternalPass 01/01/20001
aaaOOBEInternalFailA-50301/02/20002
bbbOOBEInternalPass 01/02/20002
....................
aaaOOBEInternalFail 01/05/20003
bbbOOBEInternalFail A-505

01/05/2000

3

aaaOOBEInternalPass 01/05/20004

 

I would like if the test is still fail in the following day, to get the latest ticket for the same name, type and execution. 
An exanple of what I expect:

nametypeexecutionresultticketdatejob_id
aaaOOBEInternalPass 01/01/20001
bbbOOBEInternalPass 01/01/20001
aaaOOBEInternalFail A-50301/02/20002
bbbOOBEInternalPass 01/02/20002
aaaOOBEInternalFail A-50301/05/20003
bbbOOBEInternalPass A-50501/05/20003
aaaOOBEInternalPass 01/05/20004

 

Also, as you can see in the expected result. If the result become "Pass" the ticket should not be added. What it mean for me. Is that I should only get the latest not null value of ticket that was fail. If the latest result was pass. We should not take the ticket in consideration. 

 

I hope my topic is clear. If anyone need more explanation, do not hesitate !

 

Best regards

Steph

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

HI @Cydevos ,

Do you mean to summary your records and only show the last records who have a ticket number? If this is a case, you can try to use the following DAX formula to get a summarized table.

Table =
SUMMARIZE (
    FILTER ( Table, [Ticket] <> BLANK () ),
    [job_id],
    [Date],
    [Name],
    [Type],
    [execution],
    "ticket", MAX ( Table[ticket] )
)

Notice: Your ticket column seems like text type, it is hard to find out first/last text value, I'd like to suggest extract numeric value to a new column and apply max function on new column to get last value.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Cydevos ,

Do you mean to summary your records and only show the last records who have a ticket number? If this is a case, you can try to use the following DAX formula to get a summarized table.

Table =
SUMMARIZE (
    FILTER ( Table, [Ticket] <> BLANK () ),
    [job_id],
    [Date],
    [Name],
    [Type],
    [execution],
    "ticket", MAX ( Table[ticket] )
)

Notice: Your ticket column seems like text type, it is hard to find out first/last text value, I'd like to suggest extract numeric value to a new column and apply max function on new column to get last value.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors