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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Return value of column, if certain criteria is met.

Hello everybody,

 

 

I have a table with lot's of process sequences listed up. 

Each process sequence is one separate line, with a different status, and different time stamp.

I want now to get one special timestamp, if it matches the criteria, and return the time stamp as new column (only if criteria is met). How can I do it? 

 

I tried like that, but it fails because of "no single value in table...":

 

Special time stamp = Calculate(MAX(PhaseInfo[DateTime],Filter(PhaseInfo,PhaseInfo[Operation_ID] = "Finishing" && PhaseInfo[Phase_ID] = "HAND" && PhaseInfo[Action_CD] = "226")))
 
-> Basically it should return the timestamp (DateTime), if those 3 criterias are matched in that single line (Finishing, Hand, 226).
 
Thanks in advance!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Since you did not give a specific table, I had to create my own table for testing according to your description, please point out if there are any problems.

Please try below steps:

1.below is my test table

PhaseInfo:

vbinbinyumsft_0-1662454826419.png

2. add a new column with below dax formula

Special time stamp =
CALCULATE (
    MAX ( PhaseInfo[Date Time] ),
    FILTER (
        PhaseInfo,
        PhaseInfo[Operation_ID] = "Finishing"
            && PhaseInfo[Phase_ID] = "HAND"
            && PhaseInfo[Action_CD] = 226
    )
)

vbinbinyumsft_1-1662454943778.png

Please refer the .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

Since you did not give a specific table, I had to create my own table for testing according to your description, please point out if there are any problems.

Please try below steps:

1.below is my test table

PhaseInfo:

vbinbinyumsft_0-1662454826419.png

2. add a new column with below dax formula

Special time stamp =
CALCULATE (
    MAX ( PhaseInfo[Date Time] ),
    FILTER (
        PhaseInfo,
        PhaseInfo[Operation_ID] = "Finishing"
            && PhaseInfo[Phase_ID] = "HAND"
            && PhaseInfo[Action_CD] = 226
    )
)

vbinbinyumsft_1-1662454943778.png

Please refer the .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Binbin Yu,

 

this measure is working now. The only issue is, that it gives me the time stamp from a different batch.

So basically the table you have created, has for each time stamp also a batch number in relation.

What's now missing is, that it takes the "special time stamp" for that exact batch number, which is present in my table report. How can I do this now?

 

My table looks like this now:

Fbnt_0-1662712818460.png

 

The "special time stamp" is not from "OW2226". So what can I do now?

Thanks!

 

Anonymous
Not applicable

Hi @Anonymous ,

I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting.

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_ Binbin Yu

amitchandak
Super User
Super User

@Anonymous , other than one parenthesis position, the measures seem correct

 

Special time stamp = Calculate(MAX(PhaseInfo[DateTime]) ,Filter(PhaseInfo,PhaseInfo[Operation_ID] = "Finishing" && PhaseInfo[Phase_ID] = "HAND" && PhaseInfo[Action_CD] = "226"))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.