Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Bar charts: Help with categorization

I need help creating a bar chart that categorizes a value. This category needs to be sorted in the same way every time and it needs to show empty categories. 


We created this in Tableau and I am having trouble figuring out how to recreate it in power bi. 

 

It looks like this: 

Each 'count' is a number 0 to 100. 

 

I have gotten some parts of this to work but I can't seem to polish out the details. 

The sorting kind of works. It is in the correct order, but the second category does not show up. I don't know why this is as I have selected "Show items with no data." I also don't know if there is a way to hide that in the final visual, as it will be confusing for the end users to see that. 

 

What I have done is create a new column for each value I need to categorize as well as a corresponding sort column. I feel like this is a bad way to go about doing this but I am not sure what else to do.

 

Is there a way to make a mesure that will 'house' the five categories? That way, I can just have that mesure as my x axis and just add the values I need for each chart. 


Any help or ideas appreciated! 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    According to your statement, I think you can try 'Sort by Column' function in Column Tool.

    Create an conditional column in Power Query Editor.

    Then sort [X aixs] column by [Index].

    For reference:

    Sort one column by another column in Power BI - Power BI | Microsoft Learn

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    According to your statement, I think you can try 'Sort by Column' function in Column Tool.

    Create an conditional column in Power Query Editor.

    Then sort [X aixs] column by [Index].

    For reference:

    Sort one column by another column in Power BI - Power BI | Microsoft Learn

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.