Forum Discussion

NishPatel's avatar
NishPatel
Resolver II
4 years ago
Solved

Two column with grouped rows

Hi, Is it possible to create below matrix in power BI?  
  • PaulDBrown's avatar
    PaulDBrown
    4 years ago

    NishPatel 

    Thanks for that. It really helps.

    Caveat: this example follows the criteria laid out in your latest data sample. In other words, the % split by cost type is the same for each company. If the split is different for each company, we need a table with the detailed % split by cost type and by company to make the correct calculations

    Ok, here is one way. You need to create intermediate tables in Power Query for the % calculations (which involves custom - calculated- columns and unpivotting) to finally append them all in a final table. Just beware that every cost type must have a % split summing to 100% (I've added a new calulation in the Spare Parts Table costs for the 80% not accounted for in your example). This way the sum of cost breakdown will equal the sum of the corresponding amount.

    The table looks like this:

    You can then use the Cost Type and Cost Breakdown fields to structure the matrix. The measure is a simple sum:

    By cost type

     

    By company

     

     

    I've attached the sample PBIX file