I have a fixed format table and am trying to use the switch formula to calculate different rows together. I have allocated a 1,2,3 to a particular row with 1 - sum base data, 2 - sum total administrative expense, 3 - running total.
Financial Value = var SelectedCalcType = SELECTEDVALUE('Management accounts structure'[calctype]) RETURN SWITCH(SelectedCalcType, 1,[Total Amount], 2,[Total administrative expenses], 3,[total Amount Running Total], BLANK())
[Total Amount] is:
Total Amount = SUM('Glentry query'[Debit/Credit Amount])
[Total administrative expenses]
Total administrative expenses = [Staff related costs]+[Other administrative costs]
[Staff related costs] is
Staff related costs = CALCULATE([Total Amount],'Account mapping query'[ManagementHeader]="Staff related costs")
and [Other administrative costs] is the same but with Other administrative costs as the filter.
Now this works for everything but 2 as this is a subtotal of the 2 previous rows above it so in a way sits outside of 3. Does anyone have any ideas as to how to show subtotals in power bi?
This is the management accounts structure:
This is my data relationships: