Forum Discussion

NipponSahore's avatar
NipponSahore
Icon for Resolver II rankResolver II
8 years ago
Solved

Filtering matrix only on columns, but display all rows

Hi all, 

 

I got a requirement where i have the data available in the following format 

 

Customer Item sold Item type Amount 
Customer1Item1Type 11
Customer2Item2Type 21
Customer3Item4Type 21
Customer4Item2Type 21
Customer5Item3Type 11
Customer6Item4Type 21
Customer7Item3Type 11
Customer8Item1Type 11
Customer9Item2Type 21
Customer10Item4Type 21
Customer1Item2Type 21
Customer2Item3Type 11
Customer3Item4Type 21
Customer4Item3Type 11
Customer5Item1Type 11
Customer6Item2Type 21
Customer7Item4Type 21
Customer8Item2Type 21
Customer9Item3Type 11
Customer10Item4Type 21

 

My requriement is to visualize data in a matrix and allow to slice data on Item type (Type1/Type2), However still show all the customers where sale is not made for said item type. 

 

Example output on slicing on Item Type = Type 1

 

Customer Item 1Item3
Customer11 
Customer2 1
Customer3  
Customer4 1
Customer511
Customer6  
Customer7 1
Customer81 
Customer9 1
Customer10 

 

 

Similaryly, slicing on Item Type = Type 2

Customer Item 2Item4
Customer11 
Customer21 
Customer3 1
Customer41 
Customer5  
Customer611
Customer7 1
Customer81 
Customer91 
Customer10 1

 

Please show me the light. :) 

  • v-piga-msft's avatar
    v-piga-msft
    8 years ago

    Hi NipponSahore,

     

    I'm sorry for misunderstand your requirement before. Now you could follow the steps below to get your desired output.

     

    1. Create a calculated table to get the all customers and create the relationship of the two tables.

     

    Table = VALUES(Sheet22[Customer ])

    2. Create the measure in your original table.

     

    Measure = var a= COUNT(Sheet22[Amount ]) return IF(ISBLANK(a),0,1)

    3. Then you could ceate the matrix with the new Customer you created in the Table as Rows and Item sold as Columns , the measure as Values.

     

    You could see the difference with the picture below.

     

    For reference, you could have a look at my pbix file which has been attached.

     

    Hope this can help you!:smileywink:

     

    Best Regards,

    Cherry

6 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi NipponSahore,

     

    Do you want to have the output below?

     

    If it is your requirement, you only need to create the matrix with the Customer as Row, Item sold as Column and Amount as Values.

     

    If I misunderstood your case, please let me know and show your expcted output, so that we can help further investigate on it?

     

    Best Regards,

    Cherry

    • NipponSahore's avatar
      NipponSahore
      Icon for Resolver II rankResolver II

      Hi v-piga-msft

       

      Acutally my output should be be different. 

       

      I want it to display list of all the customers not just one's who've been sold the item under that type. 

       

      So, in the matrix 

       

      Rows --> All Customers

      Columns --> only items which lie in Item type

      Value -->  1 or 0 if item is sold  or not respectively

      • NipponSahore's avatar
        NipponSahore
        Icon for Resolver II rankResolver II
         

        I got a requirement where i have the data available in the following format 

         

        Customer Item sold Item type Amount 
        Customer1Item1Type 11
        Customer2Item2Type 21
        Customer3Item4Type 21
        Customer4Item2Type 21
        Customer5Item3Type 11
        Customer6Item4Type 21
        Customer7Item3Type 11
        Customer8Item1Type 11
        Customer9Item2Type 21
        Customer10Item4Type 21
        Customer1Item2Type 21
        Customer2Item3Type 11
        Customer3Item4Type 21
        Customer4Item3Type 11
        Customer5Item1Type 11
        Customer6Item2Type 21
        Customer7Item4Type 21
        Customer8Item2Type 21
        Customer9Item3Type 11
        Customer10Item4Type 21

         

        My requriement is to visualize data in a matrix and allow to slice data on Item type (Type1/Type2), However still show all the customers where sale is not made for said item type. 

         

        Example output on slicing on Item Type = Type 1

         

        Customer Item 1Item3
        Customer11 
        Customer2 1
        Customer3  
        Customer4 1
        Customer511
        Customer6  
        Customer7 1
        Customer81 
        Customer9 1
        Customer10 

         

         

        Similaryly, slicing on Item Type = Type 2

        Customer Item 2Item4
        Customer11 
        Customer21 
        Customer3 1
        Customer41 
        Customer5  
        Customer611
        Customer7 1
        Customer81 
        Customer91 
        Customer10 1

         

        Please show me the light. Smiley Happy