Forum Discussion
RankX on axis X scatter chart - Visual
It is possible to use the RANKX function in a scatter chart in Power BI, but the measure you have provided is not quite suitable for that purpose.
To achieve the desired result, you could modify your measure in the following way:
Measure = VAR SummaryTable = SUMMARIZE( ITEM_Table, ITEM_Table[Item], "SellSum", SUM(ITEM_Table[Sell]) ) RETURN RANKX( SummaryTable, [SellSum], , ASC, Dense )
This measure creates a summary table that groups the items by their name and calculates the sum of their sales. Then it uses the RANKX function to assign a rank to each item based on their total sales, with the rank values being densely distributed.
To use this measure in a scatter chart, you can place it on the X-axis and the sum of the Sell column on the Y-axis. The scatter chart will then show the cumulative count of items on the X-axis and the total sales on the Y-axis.
Note that the RANKX function may return ties with the same rank value, which can cause issues with the scatter chart. To avoid this, you can use the DENSERANK function instead, as shown in the modified measure above.
- Bastaba3 years agoFrequent Visitor
Hello,
Thank you for your answer
I tried the solution but it is not working
I get on X axis value 1 and the sell sum on Y
I would like to have all the ranks of Item on X axis like
1 - 2 - 3 - 4 and on Y the value linked
Your DAX expression creates a value but it needs a column for the chart right ?Regards,