Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Table/Matrix with multiple column

Hi All,

 

I want to use an matrix or table in PowerBi, where i can add 02 or more columns seprately(as per imange below). I am unable to acheive the same in default PowerBi Table/Matrix.

Is there any way i can achieve the same in default (By scipting) or do i need to import a new Tabel/Matrix from market place.

 

 

Regards,

Ashraf 

  • Anonymous's avatar
    Anonymous
    6 years ago

    PaulDBrown  I want to show my data something like below, where column 1 & column 2 coming from different tables

  • Anonymous 

     

    OK, but we need to see the structure of the model. In order to be able to create the matrix with columns from different tables you will to create a common table which appends column1 and column2 values. This is what you will be using as your column reference in your matrix. 

    To get a better idea of what I'm talking about, here is a simple model:

     

     

    and you can create a matrix like this:

     

     

    Therefore, if you need to show columns from different tables (which obviously are different values) you need to create a lookup/Dim table which lists the values from your columns in one single column to use as your column values in the matrix.

     

    Here is an example for you:

     

    To create this, I referenced the data table to a new table, unpivotted the Market and Division columns (therefore creating a single column including both - which incidentally means rows values for "Actuals" and "Forecast" are duplicated, which you need to be aware of), then created a lookup table with this new column etc...

    Here is the sample file if you're interested: PBIX File

7 Replies

  • VasTg's avatar
    VasTg
    Memorable Member

    Anonymous 

     

    Your question is not quite clear.

     

    Would you like to show column1, column2 and so on? Column1, column2, etc., should be values/elements of an attribute just like plan199,plan299,plan 399, data111 etc are elements of "No of plans sold" attribute. 

     

    To achieve the expected results, your table should look like below and you could use the "Actual Column1 name"

    and "Actual Column2 Name" in the column section of matrix.

     

    Actual Column1 Name

    Actual Column2 Name

    Column1

    Plan 199
    Column1Plan 299
    Column1Plan 399
    Column2Data111
    Column2Data299
    Column2Data399

     

    If this helps, mark it as a solution.

    Kudos are nice too.