Forum Discussion
Anonymous
4 years agoNot applicable
Sort conditional formatted column
Hello, I have the following table with a conditional formatting in the "Difference" column. Week number Stock Sold Difference 1 121 89 32 2 212 200 12 3 142 105 37 4 ...
- 4 years ago
Try replacing the DAX for 'RankRaw' with the following code:
RankRaw = VAR documentId = 'Data Table'[Document ID] VAR _Threshold = DIVIDE( CALCULATE( SUM('Data Table'[Difference]), ALL('Data Table'), 'Data Table'[Document ID] = documentId ), CALCULATE( SUM('Data Table'[Stock amount]), ALL('Data Table'), 'Data Table'[Document ID] = documentId ) ) VAR statusAdjustment = SWITCH( TRUE(), _Threshold < 0.5, 10000000, _Threshold < 0.9, 1000000, 0 ) RETURN documentId + statusAdjustmentYes, you will need to display the 'Rank' column if you want to sort based on it.
mattkocak
Kudo Kingpin
4 years agoYou can do this by selecting the 'Difference' column in the fields menu. Then in the Column tools ribbon, choose to sort by the column 'Icon flag'. Now when you sort your table based on the 'Difference' column, it will actually be sorted based on the 'Icon flag' column.
I demonstrate this in the screenshot below by having the sort order of 'b' be based on column 'a'. Now sorting the table based on 'b' will actually display the sort order based on 'a'.
Let me know if I can help clarify anything. If this post was helpful, please consider giving it a thumbs up and marking it as a solution!
Best,
Matt