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
v-bastei
Microsoft Employee
Microsoft Employee

Longest test duration per test name per Log_ID

Hi,

I have a table which contains list of tests results.
The main columns are:
- Log_ID  -  iteration name

- Test  -  The test name which could be repeated in the same Log_ID multiple times

- Runtime  -  The test duration

- Type - Test type, I would like to ignore 'build' type

- State - test result, only calculate on PASSED tests

 

I would like to get the longest duration for each test name.

The SQL query is:

SELECT Log_ID, Test, MAX(Runtime) AS Max_Runtime
FROM [TesterChoice-Dev].dbo.HW_Data_Test
WHERE [Type] != 'build' and State = 'PASSED'
GROUP BY Log_ID, Test
ORDER by Log_ID, Test 

Expected results for example:

vbastei_0-1651391053228.png

 



1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @v-bastei ,

 

How about this:

tomfox_0-1651395616077.png

Here the DAX:

Measure = 
CALCULATE (
    MAX ( Table[Runtime] ),
    Table[Type] <> "Build",
    Table[State] = "PASSED"
)

 

Does this solve your issue? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

4 REPLIES 4
tackytechtom
Super User
Super User

Hi @v-bastei ,

 

How about this:

tomfox_0-1651395616077.png

Here the DAX:

Measure = 
CALCULATE (
    MAX ( Table[Runtime] ),
    Table[Type] <> "Build",
    Table[State] = "PASSED"
)

 

Does this solve your issue? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Looks like it does.
Thanks!!

v-bastei
Microsoft Employee
Microsoft Employee

Hi @tackytechtom ,

I have hided some irrelevant columns but here is an example for my data:

vbastei_0-1651393147608.png

I would like to show the longest test duration for each test per Log_ID, here you can see one test name per log id but it might be few tests that repeated few time with a different Seed which makes it uniqe, also, build test type should not take in account

I would like to show it as a table just like it shown in the question, inside a PowerBI dashboard, so it probably should be DAX.

tackytechtom
Super User
Super User

Hi @v-bastei ,

 

Please could you provide the exact sample data for your expected result? Also, you want it to be solved in Power Query and not as a DAX measure, correct?

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.