Forum Discussion
Filter off matching rows in Matrix
I have a matrix setup and I'm using the columns to pull out my Prod, QA, and Dev into columns. This is working great. However I only need to see the rows that aren't matching. Can anyone think of a way to filter off the matching rows? I have slicer to filter Dev, QA, Prod, and one other. So we can compare up to 4 different systems at once.
Anonymous,
Use this measure as a filter in the matrix:
Environment Match = VAR vDev = CALCULATE ( MAX ( Table1[Value] ), Table1[Environment] = "Dev" ) VAR vQA = CALCULATE ( MAX ( Table1[Value] ), Table1[Environment] = "QA" ) VAR vProd = CALCULATE ( MAX ( Table1[Value] ), Table1[Environment] = "Prod" ) VAR vResult = IF ( vDev = vQA && vDev = vProd, 0, 1 ) RETURN vResult
3 Replies
- DataInsightsSuper User
Anonymous,
Use this measure as a filter in the matrix:
Environment Match = VAR vDev = CALCULATE ( MAX ( Table1[Value] ), Table1[Environment] = "Dev" ) VAR vQA = CALCULATE ( MAX ( Table1[Value] ), Table1[Environment] = "QA" ) VAR vProd = CALCULATE ( MAX ( Table1[Value] ), Table1[Environment] = "Prod" ) VAR vResult = IF ( vDev = vQA && vDev = vProd, 0, 1 ) RETURN vResult- AnonymousNot applicable
This wasn't exactly what I needed but it got me 95% there. Thank you!
I had to had vProd = vQA in the return. The issue was that when I compare all of them like that then it would return results even if I didn't have one selected in the slicer.
For example: Unit of measure | Dev Inches/Hour | Prod Inch per hour | QA Inches/Hour
Becuase it was always comparing all 3, even if I deseltected PROD from my slicer it would still show up in the matrix.
To solve this I created a measure for each Prod, Dev, QA that looks to see if it's filtered. From there I could plug those values into what you gave me and change my ouput based on it.
<Code from measure> Wouldn't let me reply if I kept it in hereSo now based on what I select it changes how to calculate the output. I need to add "BU" as an option still.
I'm sure this probably isn't the cleanest way to do it but it works!
Couldn't have gotten there without your help, thank you!- AnonymousNot applicable
Match = VAR vDev = CALCULATE ( MAX ( 'All'[Value] ),'All'[Source] = "Dev" ) VAR vQA = CALCULATE ( MAX ( 'All'[Value] ), 'All'[Source] = "QA" ) VAR vProd = CALCULATE ( MAX ( 'All'[Value] ), 'All'[Source] = "Prod" ) VAR vResult = if([ProdFiltered] > 0 && [QAFiltered] > 0 && [DevFiltered] > 0, IF(vProd = vQA && vProd = vDev && vQA = vDev,1,0), if([ProdFiltered] > 0 && [QAFiltered] > 0, IF(vProd = vQA,1,0), if([ProdFiltered] > 0 && [DevFiltered] > 0, IF(vProd = vDev,1,0), if([QAFiltered] > 0 && [DevFiltered] > 0, IF(vQA = vDev,1,0), 0) ) ) ) RETURN vResult