Forum Discussion
markmess77
5 years agoResolver I
Issue with sorting column by index
I want to display a stacked bar chart with categories in a custom order with a tooltip showing the percentage of total of each category in the bar. It seems I am able to do one, but not both. The mea...
- 5 years ago
Hey markmess77 ,
when you are using a sort-by-column, you also have to add this column with an ALL. The reason is that in the background there is a group by the sort column. Check the following article if you fully want to understand the problem:
Side effects of the Sort By Column setting in DAX - SQLBI
Otherwise you can just add the sort by column:
Measure = DIVIDE ( DISTINCTCOUNT(Table[ID]), CALCULATE(DISTINCTCOUNT(Table[ID]), ALL(Workflows[Category]), ALL(Workflows[CategorySortByColumn]) ), 0 )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution โ๏ธ and give it a thumbs up ๐Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
selimovd
5 years agoMost Valuable Professional
Hey markmess77 ,
when you are using a sort-by-column, you also have to add this column with an ALL. The reason is that in the background there is a group by the sort column. Check the following article if you fully want to understand the problem:
Side effects of the Sort By Column setting in DAX - SQLBI
Otherwise you can just add the sort by column:
Measure =
DIVIDE (
DISTINCTCOUNT(Table[ID]),
CALCULATE(DISTINCTCOUNT(Table[ID]), ALL(Workflows[Category]), ALL(Workflows[CategorySortByColumn]) ),
0
)
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution โ๏ธ and give it a thumbs up ๐
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic