Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 447

Power BI - using Switch to calculate subtotals in an income statement

$
0
0

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?

enter image description here

This is the management accounts structure:

This is the management accounts structure:

This is my data relationships:

data relationships

Updated data relationships:Updated data relationships

and what the matrix table currently looks like:what the matrix table currently looks like


Viewing all articles
Browse latest Browse all 447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>