Forum Discussion

nasreu's avatar
nasreu
New Member
3 years ago

Custom / hybrid / dynamic Matrix

Hi all,

I am strugling to build a custom matrix, I have found some similar topics but I could not figure how to adapt it to my issue.

I already checked the following examples :

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591 PaulDBrown 

https://powerbi.tips/2019/07/the-dynamic-time-matrix/

https://exceleratorbi.com.au/building-a-matrix-with-asymmetrical-columns-and-rows-in-power-bi/

 

All the examples above have 1 level column header calculation.

So here is my example:

 

Input data :

Table 1 from an excel sheet.

Table 1
DateLabelcode CountNo of Lines
09/01/2022Product 111
09/01/2022Product 111
15/01/2022Product 111
15/01/2022Product 111
30/01/2022Product 1110
10/02/2022Product 1601
10/05/2022Product 1101
09/07/2022Product 211
09/09/2022Product 2501
09/01/2023Product 3150
09/02/2023Product 301
10/02/2023Product 511
09/03/2023Product 3030
............

Table 2 from another excel sheet, which have the Label column in common

Table 2
Label       Target2023
Product 160%
Product 270%
Product 380%
Product 480%
Product 595%
Product 660%
Product 750%
Total89%

 

Output:

In Excel, it can be done with a basic pivot table (at least the part without the target).

 

The calculations for the columns are :

item = sum(No of Lines)

late = sum(No of Lines) - sum(Code Count)

percent = sum(No of Lines) / sum(Code Count)

 

The month should evolve dynamically (if there is a new data in a new month, the new month for the actual year should appear and added in the total calculation of the new year). (Like https://powerbi.tips/2019/07/the-dynamic-time-matrix/)

 

A variation can be proposed regarding the column header like the following:

2 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Apologies upfront because I'm really pushed for time, so cannot go into detail about how to build the model for 2 level headers. Please check the following file to see if it helps in any way (file attached)

    • nasreu's avatar
      nasreu
      New Member

      Hi,

       

      Thank you for the file, I will try and check if it can help me.

      If anyone has other tips, please feel free to answer.

       

      Thanks again.