Forum Discussion

Zakk2000's avatar
Zakk2000
Regular Visitor
3 years ago
Solved

Creating matrix visual using values as row header/value

Hi All,   I am stuck on creating a visual using Matrix.   Sample Data: Case No. Sales by  Being Assistant 1 Being Assistant 2 1A Person A Person B Person C 2B Person A Person B ...
  • Greg_Deckler's avatar
    Greg_Deckler
    3 years ago

    Zakk2000 I was assuming that you would just use Sales by column in your matrix visual. If for some reason that is not feasible, you could create a new table like this (I would leave as a disconnected table).

    Person Table = 
      DISTINCT(
        UNION(
          SELECTCOLUMNS('Table',"Person",[Sales By]),
          SELECTCOLUMNS('Table',"Person",[Being Assistant 1]),
          SELECTCOLUMNS('Table',"Person",[Being Assistant 2]),
        )
      )

     

    You would change the measures like this:

    Sales By Measure = 
      VAR __Person = MAX('Person Table'[Person])
      VAR __Result = COUNTROWS(FILTER(ALL('Table',[Sales By] = __Person
    RETURN
      __Result
    
    Sales By Being Assistant 1 Measure =
      VAR __Person = MAX('Person Table'[Person])
      VAR __Result = COUNTROWS(FILTER(ALL('Table'),[Being Assistant 1] = __Person))
    RETURN
      __Result
    
    Sales By Being Assistant 2 Measure =
      VAR __Person = MAX('Person Table'[Person])
      VAR __Result = COUNTROWS(FILTER(ALL('Table'),[Being Assistant 2] = __Person))
    RETURN
      __Result
    
    
    Total Cases Measure = [Sales By Measure] + [Sales By Being Assistant 1 Measure] + [Sales By Being Assistant 2 Measure]