cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Exanimis Frequent Visitor
Frequent Visitor

Sort graph value as count distinct

Lets say I have column chart where:

- Value is "Count Distinct of a column ID" (with duplicates thus distinct count)

- Axis is column B with categories

How can I sort this graph based on the Value (Distinct Count of IDs)?

 

I do not want to modify the table to remove duplicates as it contains other columns with information and also has relations to a different table.

I do not want to create another table with deduplicated IDs for this graph as I would not be able to have all the relations that I'm using on a different column.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Sort graph value as count distinct

HI @Exanimis,

 

Add a calculated column to calculate distinct count based on current group, then use sort by column function to use this calculated column as sort column of column who used on value field.

Sort by column in Power BI Desktop

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Community Support Team
Community Support Team

Re: Sort graph value as count distinct

HI @Exanimis,

 

Please modify your type column to text type, it seems like default sort feature disabled when you use numeric value as axis.

29.gif

 

For this scenario, you not need calculate column anymore.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Sort graph value as count distinct

HI @Exanimis,

 

Add a calculated column to calculate distinct count based on current group, then use sort by column function to use this calculated column as sort column of column who used on value field.

Sort by column in Power BI Desktop

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Exanimis Frequent Visitor
Frequent Visitor

Re: Sort graph value as count distinct

Thank you for help, really nice and easy solution. Not sure why I did not think of that 🙂

Exanimis Frequent Visitor
Frequent Visitor

Re: Sort graph value as count distinct

Actually there was a problem with your solution. It does not sort it at all or returns an error. Let me give you an example.

 

DATA:

data.png

 

 

Sort:

 

view.png

 

Calculated column:

calcol.png

Community Support Team
Community Support Team

Re: Sort graph value as count distinct

HI @Exanimis,

 

Please modify your type column to text type, it seems like default sort feature disabled when you use numeric value as axis.

29.gif

 

For this scenario, you not need calculate column anymore.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 358 members 3,592 guests
Please welcome our newest community members: