I am trying to get the RunningTotals Corrected in above Visual to break the tie , so it should be 18.60 then 37.21 and then 53.49 and so on , for some reason it giving me Runningtotals by adding number which have same scrapcoderank, any idea how to fix this ???
Firstly, in your measure, are you using RANKX() to calculate the measure [ScrapCodeRANK]? If you are, RANKX() will always return the same ranking for the same value.
In addition. TopN() will take all the rows with same value in a column as one row. So, to achieve your requirement, you should use edit query to create a new ranking column instead of using DAX.
Please refer to steps below:
Calculate [%ByScrapCode] using Power Query instead of DAX in Power BI Desktop, which will make [%ByScrapCode] as a column in your table, if you have any questions about how to calculate [%ByScrapCode] in query editor, please share sample data of your table.
Sort table ‘DimTransaction’ by column [%ByScrapCode], then create an index column [ScrapCodeRANK] from 1. You can use M formula below in Edit Queries:
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bc2xDcAwCATAXZDSWQhMwHgWy/uvYV6KuxTfnJ5nLepdnBqNigb3fGi3UjUpSWhyyKcy/E8D1wE1nn4XBAtvZbLdqiqqhjpP/NoH", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Scrap_Code = _t, Scrap_Total_Qty = _t, #"%ByScrapCode" = _t]),