Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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:
Solved! Go to Solution.
Hi @v-bastei ,
How about this:
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! | |
| #proudtobeasuperuser | |
Hi @v-bastei ,
How about this:
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! | |
| #proudtobeasuperuser | |
Looks like it does.
Thanks!!
Hi @tackytechtom ,
I have hided some irrelevant columns but here is an example for my data:
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.
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! | |
| #proudtobeasuperuser | |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |