Forum Discussion
Dynamic Chart title for column chart for TOP N selected in Filter page (count--number)
- 3 years ago
Hi Apar_FM ,
Based on your description, I have created a simple sample:
Please try to apply the measure to the title:
Measure = var _a = COUNT('Table'[ID]) return "Net Sales by State for Top "&_a&" State"Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
To create a dynamic chart title that displays the count of the top N states selected in the filter pane, you can use the following measure:
Chart Title = "Net Sales by State for Top " & RANKX(ALLSELECTED('Sales'[State]), 'Sales'[Net Sales],, ASC, DENSE) & " States"
This measure uses the RANKX function to determine the rank of each state based on its net sales, and then displays the rank as the chart title. The ALLSELECTED function is used to ensure that the ranking is based on all of the states currently selected in the filter pane.
Hi DataSlyer,
It is not working. Maybe I am not able to understand my query better so I am rewriting it with a chart example..
Below is my chart where I already have the best 5 from the filter pane.
Now i dont understand is that how RankX will help me. I belive its may be count formula which is to be used.
Now from below if i choose 5 then it shows in title as 5 if top 7 then 7....