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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Fbnt
Frequent Visitor

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
v-binbinyu-msft
Community Support
Community Support

Hi @Fbnt ,

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
v-binbinyu-msft
Community Support
Community Support

Hi @Fbnt ,

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.

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!

 

Hi @Fbnt ,

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

@Fbnt , 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"))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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