I have a visual which looks like this:
It shows the total sales for the top 5 stores using a top N type filtering. This definitly doesn’t work, because the top 5 stores in May could be different to the top 5 stores in June, etc… I understand it takes the top 5 of the Total and filters out the rest.
So I build a measure with RANKX():
Rank Store by Sales = RANKX( ALL('Sales'[StoreName]), [Total Sales], ,DESC)
And:
TopN Printed Pages by Printer = IF([Rank Store by Sales] <= 'Number of top values'[Number of top values Value], [Total Sales])
(‘Number of top values'[Number of top values Value] being a parameter for the user to set).
But now:
After replacing the Y-Axis field of the visual from [Total Sales] to my new [TopN Sales by Printer], the visual works as expected, but it looks very bad, as I imagine PowerBI keeps a spot for all the other categories which aren’t in the top N, and it turns out blank. Any way I can fix this visual?