Forum Discussion

djillbunters's avatar
djillbunters
Frequent Visitor
2 years ago
Solved

Showing calculated column in matrix while showing measures as rows

I'm trying to create a P&L report in PBI Desktop. My dataset (high level) exists of a table with actuals (GLAccount, Amount, Date) and a table with budget (GLAccount, Amount, Date). I combined the ...
  • Greg_Deckler's avatar
    2 years ago

    djillbunters If I understand this correctly, you will need to use a disconnected table consisting of rows:

    Actual

    Budget

    Delta

     

    Use that as your column header. Then you will need to modify your measures such as:

     

    Turnover = 
      VAR __Category = MAX('DisconnectedTable'[Column1])
      VAR __Result = 
        SWITCH( __Category, 
          "Actual", SUMX(FILTER('Table', [Classification]="Actual"), [Value]),
          "Budget", SUMX(FILTER('Table', [Classification]="Budget"), [Value]),
          SUMX(FILTER('Table', [Classification]="Actual"), [Value]) - SUMX(FILTER('Table', [Classification]="Budget"), [Value])
        )
    RETURN
      __Result
    

    It's essentially a simple version of this: The New Hotness (Custom Matrix Hierarchy) - Microsoft Fabric Community