Forum Discussion
Anonymous
2 years agoNot applicable
Comparing Test Cases Between Different Versions in Power BI
Title: "Comparing Test Cases Between Different Versions in Power BI"
3 hours ago
I have a dataset with two columns: "Test Case" and "Version."
- Different versions can contain the same or different test cases.
- In Power BI, I've created a matrix to display test cases for different versions side by side.
- I also have a slicer that allows users to select two versions for comparison.
- Let's say Version 1.1 is the older version, and Version 1.2 is the newer one.
- I want to know how to:
- Generate a table or use another method to display a list of test cases that have been removed from Version 1.2 compared to Version 1.1.
- Generate a table or use another method to display a list of test cases that have been added to Version 1.2.
- Generate a table or use another method to display a list of test cases that are common to both Version 1.1 and Version 1.2.
here is my current solution but the list it return can not be displayed in a table, only showing as a string list can be displayed as a value in a matrix table.
RemovedTestCases =
VAR SelectedVersions = VALUES('data'[Version])
VAR SelectedVersionCount = COUNTROWS(SelectedVersions)
RETURN
IF(
SelectedVersionCount = 2,
VAR SelectedVersionA = MINX(SelectedVersions, [Version])
VAR SelectedVersionB = MAXX(SelectedVersions, [Version])
VAR RemovedTestCasesList =
EXCEPT(
VALUES('data'[Test Case]),
CALCULATETABLE(
VALUES('data'[Test Case]),
'data'[Version] = SelectedVersionB
)
)
RETURN
CONCATENATEX(RemovedTestCasesList, 'data'[Test Case], UNICHAR(10),
BLANK()
)
)
here is the sample data:
| Test Case | Version |
| A1.1 | Version 1.1 |
| A1.2 | Version 1.1 |
| A1.3 | Version 1.2 |
| A1.2 | Version 1.2 |
| A1.1 | Version 1.3 |
| A1.6 | Version 1.3 |
| A1.2 | Version 1.3 |
Any recommendations on how to solve the problem? Many thanks!
1 Reply
- lbendlin
Super User
Read about the EXCEPT() function in DAX.