Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Sorting Stacked Bar Chart by Axis Values

Hi Member, 

 

In the following Graph- I am looking to sort the values on Axis (Screen Time) either ascendingly/ descendingly.

Can anyone suggest how do i proceed. 

 

image.png

 

 

 

1 ACCEPTED SOLUTION

Hi,

 

Do not write a calculated column formula.  Write a formula in the Query Editor instead

 

=If [Status]="Considered" then [Interview Date]-[Application Date] else null


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

 

In the Data Model, it looks like to the screen time column is formatted as a text column.  Change the formatting to Numbers.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

And yes, Ashish- It was formatted as Text earlier.

Hi,

 

So does the graph now pan out correctly?  If yes, then please mark my reply as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

I tried this- to change Text to Column

Changed Data Type udner Formatting from Text to Whole Numbers.

 

And then, the Screen Time Column started showing #Error for all values and under modelling shows "Cannot convert value '' of type Text to type Integer."

Is there something wrong with my syntax in modelling?

 

Screen Time = IF('Raw Data'[Status]="Considered",
FORMAT(DATEDIFF('Raw Data'[Application Date],'Raw Data'[Interview Date],DAY),""),
"")
 
Thanks

 

 

Hi,

 

Do not write a calculated column formula.  Write a formula in the Query Editor instead

 

=If [Status]="Considered" then [Interview Date]-[Application Date] else null


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

The graph looks the way i wanted it to, but it is not showing odd values on Y Axis. 

How can i make it plot all values? image.png

 

Look at the axis options.  There should be some setting there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish, It did work. Thanks again.

May i know why we used Query Editor and not the Add Column in Data.

You are welcome.  I am sure it can also be solved by using a calculated column.  In a calculated column, you can only have a single data type.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.