Search code examples
sqlreporting-servicesssrs-2008powerbi

How to divide two rows of same column in SSRS/Powerbi?


Account Name          Balance
YTD                   10000
Interest              100
Depreciation          500
Less Distributions    -7000
Plus Paid in Capital  600
Principal             2600

I have a table like this I need a new row which gives me the result of division of balance in ytd to interest.

Expected out put:

Account Name          Balance
YTD                   10000
Interest              100
Depreciation          500
Less Distributions    -7000
Plus Paid in Capital  600
Principal             2600
Result                100      //(i.e 10000/100)

Solution

  • =SUM(IIF(Fields!AccountName.Value = "YTD", Fields!Balance.Value, Nothing)) / SUM(IIF(Fields!AccountName.Value = "Interest", Fields!Balance.Value, Nothing))