Forum Discussion
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:
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/
4 Replies
- tackytechtom
Most Valuable Professional
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/ - v-bastei
Microsoft Employee
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. - tackytechtom
Most Valuable Professional
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/- v-bastei
Microsoft Employee
Looks like it does.
Thanks!!