Forum Discussion
bcastillo
8 years agoFrequent Visitor
Issues with order in column
Hello, I am working on a line chart and the x-axis is supposed to have rolling quarters but power bi is sorting the quarters for me and they are out of order. Here is the picture of my data and ...
- 8 years ago
Hi bcastillo
I can reproduce your problem.
My "Quarterly data" column is of text type, when I add it to the axis of the line chart,it will sort by another column of number type by default. picture below is an example.
One workaround is:
create a Index column in Query editor
Then in Report View, select "Quarterly data" column, then select on the Modeling->Sort by column, click on the "Index" column.
Next on the Line chart, select the three dots on the upper-right of it, select "Sort by"->"Quarterly data".
Best Regards
Maggie
bcastillo
8 years agoFrequent Visitor
I am getting an error message when I use that code
Spoiler
Cannot convert value 'Q2-17Q2-17' of type Text to type Date.
Seward12533
8 years agoSolution Sage
Format will require it in date format. Instead just extract the year and quarter number from your text.
Something like VALUE(RIGHT([Quarterly Data],2)&MID([Quarterky Data],2,1])
May need to play with the start on the Mid I always get confused if it starts with 0 or 1 as the first character.
Something like VALUE(RIGHT([Quarterly Data],2)&MID([Quarterky Data],2,1])
May need to play with the start on the Mid I always get confused if it starts with 0 or 1 as the first character.
- bcastillo8 years agoFrequent Visitor
When I try to change the format as a Date it gives me this error