The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I am running into a strange issue. For my stacked bar chart below, I want to change the order in the visual so that "N/A" is last.
I tried this 2 ways:
1.) Created a new table of the legend items above, with a column for "order." I then created a new column in the original data table using RELATED to pull in the order into the original data table.
2.) Inserted a new conditional column, assigning each legend item an order number (consistently = 1, inconsistely = 2, etc).
Both of these solutions caused this to happen once I did the whole "Sort By Column" thing:
Google cant seem to help. Anyone have any ideas? Thanks everyone!
Solved! Go to Solution.
Sure thing, the answer is that you need to adjust your measure. Here's more info on how to do it: https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...
Hi,
I am having trouble re-creating your issue. The only explanation that came to my mind is that the sort is somehow messing with your calculation logic (though I can't fathom why). In my test data I built a relation between the table and sort table and used related and used RELATED to get the sort column. Then I sorted the category table's category using this sort column and everything works fine:
Could you provide some more information on your problem?
Proud to be a Super User!
@ValtteriN I found another post describing exactly what I am experiencing, and I was able to fix my issue!
https://community.powerbi.com/t5/Desktop/Sort-By-Column-changes-the-Measure-results/m-p/91258
Hi,
That's great! I would be good if you post your solution to this dicussion and mark it as a solution so that people will find the answer easier in the future.
Proud to be a Super User!
Sure thing, the answer is that you need to adjust your measure. Here's more info on how to do it: https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...
Thank you for your help! Here is a file of example data and I am experiencing the same behavior in this example data. When I sort "Survey Question" by "Survey Question Sort," then all of the percentages on my stacked bar chart change to 100%. If I sort "Survey Question" by itself, then this does not happen and the percentages are all correct.
Example File - Sort/Stacked Bar Chart Problem
(I wish I could just attach it right here to this post but I don't have that option - I think it's because I'm still a bit of a newbie).
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
8 | |
8 |