Forum Discussion
Split Values in Matrix by Different Rows (Which have the same type of data)
I am displaying 2 different calculated measures in a matrix (Comp 1st Review and Comp 2nd Review). As seen below:
| Comp 1st Review | Comp 2nd Review |
| 8 | 4 |
I then split the above values by Computation1stReviewer. This field displays a list of peoples names, therefore the below matrix outputs a count of rows of each person for each measure:
| Computation1stReviewer | Comp 1st Review | Comp 2nd Review |
| Person A | 1 | 0 |
| Person B | 2 | 3 |
| Person C | 5 | 1 |
| Total | 8 | 4 |
The above was performed by adding Computation1stReviewer to 'Rows', as seen below:
My challenge is that I would not like the second measure (Comp 2nd Review) to be split into rows based on Computation1stReviewer, but I would like it to be split into rows by a different field, Computation2ndReviewer, which also displays a set of names. Therefore, below is the output which I am seeking:
| Computation1stReviewer | Comp 1st Review | Comp 2nd Review |
| Person A | 1 | Comp 2nd Review Filtered by Computation2ndReviewer[Person A] |
| Person B | 2 | Comp 2nd Review Filtered by Computation2ndReviewer[Person B] |
| Person C | 5 | Comp 2nd Review Filtered by Computation2ndReviewer[Person C] |
| Total | 8 | 4 |
Note that there exists an overlap in names between Computation1stReviewer and Computation2ndReviewer. Although some names do exist in the former measure that do not exist in the latter, and vice versa.
I am unsure how to go about this, and would greatly appreciate any help or suggestions that you might have. Thank you!
Hi lukexuereb ,
Try the following formula:
Measure = var _1 = CALCULATE( DISTINCTCOUNT('Table'[Column2]), FILTER( ALL('Table'), 'Table'[Computation2ndReviewer] = MAX('Table'[Computation1stReviewer]) ) ) return IF( ISFILTERED('Table'[Computation1stReviewer]), _1, [Comp 2nd Review] )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- Greg_DecklerCommunity Champion
lukexuereb Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.- lukexuerebRegular Visitor
Greg_Deckler I have updated my question and described the process step by step, hope it helps!
- Greg_DecklerCommunity Champion
lukexuereb I'm still not clear on what your source data looks like. However, it sounds like you have two columns of names. Try upivoting those columns and then you can filter by the Attribute field in your measures?
- v-kkf-msftCommunity Support
Hi lukexuereb ,
Try the following formula:
Measure = var _1 = CALCULATE( DISTINCTCOUNT('Table'[Column2]), FILTER( ALL('Table'), 'Table'[Computation2ndReviewer] = MAX('Table'[Computation1stReviewer]) ) ) return IF( ISFILTERED('Table'[Computation1stReviewer]), _1, [Comp 2nd Review] )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.