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
jpc
Helper I
Helper I

Collating test results from related rows

I have source data tables of Tests and Results.   Some tests have explicit test results, but some don't; in the tests table they are defined as being dependent on other tests.

 

My objective is to add a column to the results table which is the consolidated pass/fail result, ie R3 is deemed a pass because R1 is a pass;  R4 is a fail (it is deemed a pass only if R1 and R2 pass).   How do i approach this?

 

Tests

TestDependency
R1 
R2 
R3R1
R4R1 & R2

 

Results

TestResult
R1Pass
R2Fail
R3 
R4 
1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @jpc ,

 

Would you please try to split the dependency into rows by "& " in query editor:

 

Capture5.PNG

 

Then create a new relationship between result table and test table:

 

Capture6.PNG

 

 Create a new column in test table: 

 

Result = IF("Fail" IN CALCULATETABLE(VALUES(Results[Result]),FILTER(Tests,Tests[Calculated Result] = EARLIER(Tests[Calculated Result]))),"Fail","Pass")

 

Capture7.PNG

Capture8.PNG

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ERrFulLwM8pHjyUo9O...

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

 

 

 

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @jpc ,

 

Would you please try to split the dependency into rows by "& " in query editor:

 

Capture5.PNG

 

Then create a new relationship between result table and test table:

 

Capture6.PNG

 

 Create a new column in test table: 

 

Result = IF("Fail" IN CALCULATETABLE(VALUES(Results[Result]),FILTER(Tests,Tests[Calculated Result] = EARLIER(Tests[Calculated Result]))),"Fail","Pass")

 

Capture7.PNG

Capture8.PNG

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ERrFulLwM8pHjyUo9O...

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

 

 

 

ryan_mayu
Super User
Super User

@jpc 

not clear about the logic, R3 is deemed a pass because R1 is a pass. Why in the result , R1 is pass and R3 is blank?

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for taking time to read and try to understand my problem.

 

There is no test run for R3 and R4, so the dataset doesn't contain any pass/fail information.   

I see what you're saying, the results table would actually be like this (no result exists for R3 and R4)

 

Results

TestResult
R1Pass
R2Fail

 

 

And i wonder if it helps to rename the Tests/test column as calculated result and explicitly state the implied logic behind R1 and R2 like this:

 

Tests

Calculated ResultDependency
R1_calcR1
R2_calcR2
R3_calcR1
R4_calcR1 & R2

 

 

Now, I think I can see that having a relationship between the "Test" fields in both my originally defined tables was not the right approach.   But because i can have multiple dependencies, i'm not sure that adding a relationship between Dependency and Test is valid either.

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.