Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Calculating Percentage from Table Matrix below Row

$
0
0

I have  a table Matrix as follows:

Row Group = Segment2

Column Group = Year, Month_Int

On the row Groups I've used the filter option to restrict the returned records to only show for certain values in segment2.  The results look as follows:

I'm trying to calculate the PVE per Shift as: (Number of 4.5 Shifts/Total Patient Visits)

My row group filter looks like this: =IIf(InStr(Fields!Segment2.Value, "9060") > 0
    , "Include"
    , "Exclude")

and...

=IIf(InStr(Fields!Segment2.Value, "9030") > 0
    , "Include"
    , "Exclude")

The value in the column is also an expression as follows: =Sum(Fields!Debit_Amount.Value)-Sum(Fields!Credit_Amount.Value)

When I tried this as my formula it simply sums all the values returned in the Matrix and does not consider the value '9060': =IIf(InStr(Fields!Segment2.Value, "9060"),0, Sum(Fields!Credit_Amount.Value) - Sum(Fields!Debit_Amount.Value))/=IIf(InStr(Fields!Segment2.Value,"9030"),0, Sum(Fields!Credit_Amount.Value) - Sum(Fields!Debit_Amount.Value))

I'm doing this on SQL 2008R2, any help is greatly appreciated.


Viewing all articles
Browse latest Browse all 10045

Trending Articles



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