I have a query that gives this output (this is a result from a udf, the denseRank is created as an filter for the pie charts, only this denseRanks stays as 1,2,3.. as the number of scenarios can be changing, so if I had 3 scenarios, there would be 6 lines with denseRank 3 at the bottom. for each scenario, there are always these 2 lines, capex and opex with cost):
Now I'm creating a set of pie charts that gives the percentage of capex and opex costs for each scenario.
So for example in the first pie chart, I've set the filter in category group properties as denseRank=1 as this is for my first scenario, see picture below. Similarly, I've set denseRank=2 in my second pie chart as it is for my second scenario.
And in the series label properties, I have the label expression as this (dataset2 is where the query that creates the above table):
I have a bunch of other settings like, show label as percentage with no decimal, piestartangle=270 etc.. Now I run my report and it is giving me this: the problem is the portion looks right, but the label is showing the the percentage based on the overall cost, but it really should be the percentage within each scenario, so for example 21% and 79% for scenario 1.
Is there any setting/function that I need to add? any way that I can get the right percentages without adding additional query/dataset to do the pie charts individually?
Sorry for the long post, really appreciate if you can help!!