Forum Discussion
Filtering matrix rows by a column value
I've a dataset which has few test cases running in two locations.
I'm able to pivot it using the matrix table like below.
However I would like to show it using a matrix table with the rows where the test cases didn't run for either of the location like below
Can anyone help how to show this in a matrix table?
Thanks!
Hi subhendude
You can achieve the desired result by adding 3 measures:
Firstly counters for Paris and London test cases :LondonCount = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Location]="London"))ParisCount = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Location]="Paris"))At this stage we will get your "pivoted" table:The next step is to create a "flag" measure which you can use as a filter:
TestCount = if([LondonCount]=0 || [ParisCount]=0,1,0)Now you can put it on the visual filter and filter by its values is 1:If you need red formatting for blank cells, you can base it on the first measures too.
Result:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
2 Replies
- Ritaf1983Super User
Hi subhendude
You can achieve the desired result by adding 3 measures:
Firstly counters for Paris and London test cases :LondonCount = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Location]="London"))ParisCount = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Location]="Paris"))At this stage we will get your "pivoted" table:The next step is to create a "flag" measure which you can use as a filter:
TestCount = if([LondonCount]=0 || [ParisCount]=0,1,0)Now you can put it on the visual filter and filter by its values is 1:If you need red formatting for blank cells, you can base it on the first measures too.
Result:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- subhendudeMicrosoft Employee
Thanks!