Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a dataset with two columns: "Test Case" and "Version."
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.
| 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 |
Solved! Go to Solution.
Hi @Anonymous, try this approach:
Test Case Status =
VAR _CurrentTestCase = SELECTEDVALUE( 'Table'[Test Case] ) //obtain TestCase from current row
VAR _CurrentVersion = SELECTEDVALUE( 'Table'[Version] ) //obtain version of currently selected TestCase
VAR _VersionToCompare = SELECTEDVALUE( 'Compare version'[Version] ) //obtain a version you want to compare to
VAR _CurrentTestCaseALL = //let's get all unique values of the version of the currently selected TestCase. It will be used to make comparison of item presence in prev version
CALCULATETABLE(
VALUES( 'Table'[Test Case] ),
REMOVEFILTERS( 'Table'[Version], 'Table'[Test Case] ), //remove any filters applied on 'Table'
'Table'[Version] = _CurrentVersion
)
VAR _ToCompareTestCaseALL = //now let's get all possible unique values of TestCase we want to compare to
CALCULATETABLE(
VALUES( 'Table'[Test Case] ),
REMOVEFILTERS( 'Table'[Version], 'Table'[Test Case] ), //remove any filters applied on 'Table'
'Table'[Version] = _VersionToCompare
)
VAR _CommonRows = INTERSECT( _ToCompareTestCaseALL, _CurrentTestCaseALL ) //returns only rows present in both versions
VAR _NewRows = EXCEPT( _CurrentTestCaseALL, _ToCompareTestCaseALL ) //get only new rows, i.e. present with TestCase of ToCompare version
VAR _Result =
IF(
_CurrentTestCase in _NewRows,
"New in " & _CurrentVersion,
"Present in " & _VersionToCompare
)
RETURN _Result
Make sure to turn on single select for filters and create a disconnected table with version values:
Good luck! 🙂
Hi @Anonymous ,
Please have a try.
RemovedTestCasesPercentage =
VAR SelectedVersionA = "Version 1.1"
VAR SelectedVersionB = "Version 1.2"
VAR TotalTestCases =
COUNTROWS ( VALUES ( data[Test Case] ) )
VAR RemovedTestCases =
COUNTROWS (
EXCEPT (
CALCULATETABLE ( VALUES ( data[Test Case] ), data[Version] = SelectedVersionA ),
CALCULATETABLE ( VALUES ( data[Test Case] ), data[Version] = SelectedVersionB )
)
)
RETURN
DIVIDE ( RemovedTestCases, TotalTestCases )
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, Rongtie,
I want to display a list of removed items in a table, not the percentage of removed test cases. also the 2 selectedVersion values are not fixed value, they should be any 2 values that the user selects from a version slicer.
Hi @Anonymous, try this approach:
Test Case Status =
VAR _CurrentTestCase = SELECTEDVALUE( 'Table'[Test Case] ) //obtain TestCase from current row
VAR _CurrentVersion = SELECTEDVALUE( 'Table'[Version] ) //obtain version of currently selected TestCase
VAR _VersionToCompare = SELECTEDVALUE( 'Compare version'[Version] ) //obtain a version you want to compare to
VAR _CurrentTestCaseALL = //let's get all unique values of the version of the currently selected TestCase. It will be used to make comparison of item presence in prev version
CALCULATETABLE(
VALUES( 'Table'[Test Case] ),
REMOVEFILTERS( 'Table'[Version], 'Table'[Test Case] ), //remove any filters applied on 'Table'
'Table'[Version] = _CurrentVersion
)
VAR _ToCompareTestCaseALL = //now let's get all possible unique values of TestCase we want to compare to
CALCULATETABLE(
VALUES( 'Table'[Test Case] ),
REMOVEFILTERS( 'Table'[Version], 'Table'[Test Case] ), //remove any filters applied on 'Table'
'Table'[Version] = _VersionToCompare
)
VAR _CommonRows = INTERSECT( _ToCompareTestCaseALL, _CurrentTestCaseALL ) //returns only rows present in both versions
VAR _NewRows = EXCEPT( _CurrentTestCaseALL, _ToCompareTestCaseALL ) //get only new rows, i.e. present with TestCase of ToCompare version
VAR _Result =
IF(
_CurrentTestCase in _NewRows,
"New in " & _CurrentVersion,
"Present in " & _VersionToCompare
)
RETURN _Result
Make sure to turn on single select for filters and create a disconnected table with version values:
Good luck! 🙂
This is very helpful. Thank you!!!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |