Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

A Challenge: How to show additional attribute/reference data columns in a Matrix

Hi.  Anyone has any ideas on how to produce a visualization like below?  Basically a Matrix, but with several reference columns per roww, before the repeating Matrix columns.  Thank you.

 

    JAN (columns)FEB.....
ID (row)TitleHourlyRtTypeHOURSPAYHOURSPAY 
AStudent10.00H10100.0015150.00 
BTeacher20.00H501,000.00402,000.00 
COfficer25.00O501,250.00351,750.00 
DPhysician100.00S606,000.00503,000.00 
ELawyer200.00S408,000.00301,200.00 
         
  • Step 1: I make 3 data tables below and add relationships in Power BI Desktop.

    'ID' Table:

    ID Title
    A Student
    B Teacher
    C Officer
    D Physician
    E Lawyer

     

    'HourlyRt' Table:

    Title HourlyRt Type
    Student 10 H
    Teacher 20 H
    Officer 25 O
    Physician 100 S
    Lawyer 200 S

     

    'Date' Table:

    ID HOURS Date
    A 10 2023/01/01
    B 50 2023/01/15
    C 50 2023/01/08
    D 60 2023/01/08
    E 40 2023/01/25
    A 15 2023/02/01
    B 40 2023/02/23
    C 35 2023/02/09
    D 50 2023/02/27
    E 30 2023/02/11
    A 10 2023/03/01
    B 20 2023/03/02
    C 30 2023/03/03
    D 40 2023/03/04
    E 50 2023/03/05

    Step 2: I make a measure.

    Step 3: I make a matrix and change options of the matrix.

        +/- icons: on --> off

        Stepped layout indentation: on --> off

     

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks. Not to say, It is a little complicated for newbies like me!  Let me see if I can get my head wrapped around it...  In the meanwhile,

       

      Does PowerBI support something like this?  Run a code snippet when visualization refreshes/opens. The code populates a structure with a set of fields (all elements that are needed to define a table). Then the structure is dynamically used to display both a table and a slicer.  The slicer can be used to toggle individual columns on/off, allowing the user to fine tune what is displayed....


  • Step 1: I make 3 data tables below and add relationships in Power BI Desktop.

    'ID' Table:

    ID Title
    A Student
    B Teacher
    C Officer
    D Physician
    E Lawyer

     

    'HourlyRt' Table:

    Title HourlyRt Type
    Student 10 H
    Teacher 20 H
    Officer 25 O
    Physician 100 S
    Lawyer 200 S

     

    'Date' Table:

    ID HOURS Date
    A 10 2023/01/01
    B 50 2023/01/15
    C 50 2023/01/08
    D 60 2023/01/08
    E 40 2023/01/25
    A 15 2023/02/01
    B 40 2023/02/23
    C 35 2023/02/09
    D 50 2023/02/27
    E 30 2023/02/11
    A 10 2023/03/01
    B 20 2023/03/02
    C 30 2023/03/03
    D 40 2023/03/04
    E 50 2023/03/05

    Step 2: I make a measure.

    Step 3: I make a matrix and change options of the matrix.

        +/- icons: on --> off

        Stepped layout indentation: on --> off