cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vitexo87 Member
Member

How to display only the top 10 values in a chart

I have a pie chart with a dimension that has more than 100 values and I want to present this chart only the top 10 in ascending order

 

 

Untitled2.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: How to display only the top 10 values in a chart

@vitexo87  try this

 

Measure = RANKX (ALL(DMEGF_Fornecedor[Fornecedor]),  CALCULATE(SUM(Facts [Vl_PedidoCompra])))
Super User
Super User

Re: How to display only the top 10 values in a chart

@vitexo87 Select the chart and then - click the 3 dots in top right corner of the chart...

Sort Chart.png

 

19 REPLIES 19
Super User
Super User

Re: How to display only the top 10 values in a chart

@vitexo87 You need a Rank Measure and then add that Measure in the Visual Level Filter as in the picture...

 

then in the Visual Level Filter select => is less than and type 11 (to see the top 10)

 

Display only Top N.png

 

 

teylyn Regular Visitor
Regular Visitor

Re: How to display only the top 10 values in a chart

After you've sorted your top ten issue, please consider using a different chart type. Pie charts, specifically 3D pie charts are very bad choices for data visualisations. Humans cannot easily compare wedges of a slice, and a 3D distortion makes it even more difficult.

With two or three data points, a pie chart is fine, because the differences are still easy to see, but for more than that consider horizontal bar charts, sorted by value.

 

For a more comprehensive discussion about alternatives to pie charts please read Save the Pies for Dessert by Stephen Few. 

Super User
Super User

Re: How to display only the top 10 values in a chart

To get your rank, you should be able to use the documentation for RANKX:

https://msdn.microsoft.com/en-us/library/gg492185.aspx

 

Or for EARLIER

https://msdn.microsoft.com/en-us/library/ee634551.aspx

 

 

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


achinm45 Member
Member

Re: How to display only the top 10 values in a chart

I shall add to the @Sean solution. If we can put an if condition and give default Rank value to all ranks more than 10 to not disturb the proportions on pie chart. Since its visualisation and pie chart shows proportion, seeing only top 10 over whole pie can interpret different proportions.

teylyn Regular Visitor
Regular Visitor

Re: How to display only the top 10 values in a chart

@achinm45 That is another reason not to use a pie chart in this scenario.  A horizontal bar chart does not need to add up to 100 %, whereas in a pie chart, showing only part of the data distorts their absolute value, there would have to be an 11th data point summing up all "other" data.

Super User
Super User

Re: How to display only the top 10 values in a chart

@teylyn You really don't like pie charts Smiley Very HappySmiley LOLSmiley Very Happy

 

vitexo87 Member
Member

Re: How to display only the top 10 values in a chart

HI @Sean,

 

I tried to do exactly as your example, the number of values being presented is more than 10, I took one print, where is the error?


Top 10 Suppliers Purchase Order = CALCULATE (RANKX (DMEGF_Fornecedor; sum (Facts [Vl_PedidoCompra]);; 0; Dense), ALL (Facts [Vl_PedidoCompra]))

 

 

Untitled.png

 

Highlighted
Super User
Super User

Re: How to display only the top 10 values in a chart

@vitexo87  try this

 

Measure = RANKX (ALL(DMEGF_Fornecedor[Fornecedor]),  CALCULATE(SUM(Facts [Vl_PedidoCompra])))
Sarr Regular Visitor
Regular Visitor

Re: How to display only the top 10 values in a chart

can you try the example below?. and make sure you replace your measures and Dimension 

 

InternetTotalSales = SUM( InternetSales_USD[SalesAmount_USD]) // replace with your measure here
BottomRank = RANKX(ALLSELECTED('Product'[ProductName]),[InternetTotalSales],,ASC,Dense)
BottomSalesByProduct = IF([BottomRank] <= 10),[InternetTotalSales])

 

 

then add the last measure to your chart