Background:
I'm trying to display dynamic MoM YoY percentage in Chart Subtitle, which based on the latest month in the chart.
For example, the latest month is May.22, relevant MoM YoY percentage will display as shown in below image.
![Suxel_1-1655880672695.png Suxel_1-1655880672695.png](https://community.qlik.com/t5/image/serverpage/image-id/82341iB76B94B570B893BD/image-dimensions/693x52?v=v2)
Below is the expression for Product A,
='$(=$(LatestMonth))'
& ' (MoM: ' &
NuM(Sum({1}{<ProductCategory={"Product A*"},MonthYear={'$(=$(LatestMonth))'}>} [Transaction Volume]) /
Sum({1}{<ProductCategory={"Product A*"},MonthYear={'$(=$(LatestMonth))'}>} TrnVol_LastMonth) - 1, '0%')
& ' YoY: ' &
NuM(Sum({1}{<ProductCategory={"Product A*"},MonthYear={'$(=$(LatestMonth))'}>} [Transaction Volume]) /
Sum({1}{<ProductCategory={"Product A*"},MonthYear={'$(=$(LatestMonth))'}>} TrnVol_LastYear) - 1, '0%')
& ')'
Question:
How to make the expression to be responsive on below scenario,
1. when ProductCategory is filtered to Product B only, show nothing for Product A
2. when ProductCategory is filtered to Product A - Grade II, show only % relevant to Product A - Grade II but not the overall % for Product A