Forum Discussion

harold191's avatar
harold191
New Member
7 years ago
Solved

cross matrix

I have a problem with a cross matrix.
I need to count people who, being in a classification, are also in other classifications.

Example
Table
Classification | IdPerson

           A        |        1
           A        |        2
           B        |        1
           B        |        2
           B        |        3
           C        |        2
           C        |        3

 

Matrix I should get
   | A | B | C
A | 0 | 1 | 1
B | 1 | 0 | 2
C | 1 | 2 | 0

 

As you can see, at the crossroads between classification A and B, there is a person who is in both, in A and C there is a person who repeats, in B and C there are two people who are in both classifications and so with all crosses that can be formed.

  • Hi,

    Your expected result is wrong.  The answer for A/B and B/A should be 2 (not 1).  You may download my PBI file from here.

    Hope this helps.

13 Replies

  • Hi,

    Your expected result is wrong.  The answer for A/B and B/A should be 2 (not 1).  You may download my PBI file from here.

    Hope this helps.

    • JasonLorneGiles's avatar
      JasonLorneGiles
      Regular Visitor

      Hi Anish,

       

      I downloaded your file and tried to make a matrix with your data right next to the one provided it and I get a "Can't display the visual" error. I have it set up the same way as yours in the same file too. Image of the Error 

       

       

      Any idea what I am doing wrong?

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        Click on the Format icon in the visualisation pane and remove all totals.

    • RanjanThammaiah's avatar
      RanjanThammaiah
      Helper V

      Ashish_Mathur Can you please help me the below case.

       

      I have tried the same like you have mentioned. Not sure why i am getting only the Zeros. Am i missing something from this?

       

      Sample data

      SSLUDN
      BTS1011471332
      PAS1011471332
      PAS1011471335
      BTS1011471332
      BTS1011471335

       

    • RanjanThammaiah's avatar
      RanjanThammaiah
      Helper V

      Ashish_Mathur Could you please help me to resolve the same data.

       

      Not sure if i have recreated the same way you did. but i couldn't get the exact result as you have got.

      For sure i am missing something. Could you please help me.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        Share the link from where i can download your PBI file.