Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there, I have a measure (number of insurance policies sold over time) that I want to split into two parts, new and renewed and then show these on a stacked bar chart. We have a separate variable (Type) that indicates if a policy is New or Renewed. How can I split the measure of "Policy Volume" into Policy_Volume_New and Policy_Volume_Renewed for a stacked bar chart? Or is there a better way to do it? Cheers! Ben
@benrickard Try to adjust the expression like this:
Count({<[transactionType]={'Renewal'}>}[applyID])
I would try to add the Type as a dimension to your bar chart. Then in the properties pane under presentation choose to present the bar as stacked.
The other approach is to split the expression into two expressions like you are suggesting.
Create two expressions like this.
Sum({<Type={'Renewed'}>}[Policy Volume])
Sum({<Type={'New'}>}[Policy Volume])
I see two issues with your expression.
1. You can't reference a master measure like the in an custom measure.
2. You can't do nested aggregations, like sum(count(...)), in a measure. If nesting is necessary then you need to aggregate between the two, like sum(aggr(count()))
In your case it could be enough to do like this:
Count({Your set}[applyID])
@benrickard Try to adjust the expression like this:
Count({<[transactionType]={'Renewal'}>}[applyID])
Thank you very much Vegar, that seems to have worked. Just a quick one, how to I express the same but for all the TransactionTypes that do not = 'Renewal'?
That's worked too, much appreciated!