cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
steveorme69 Helper I
Helper I

Sort in Bar Chart

Sorry as I'm sure this is a really quick fix but how do you simply change the order of a Bar Chart.

 

I want to show Income before Costs in a bar chart but Power BI sorts it alphabetically.

 

 

 

https://1drv.ms/u/s!An_LprApKikkdYzWYv1hTJpxge8

 

Thanks

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
steveorme69 Helper I
Helper I

Re: Sort in Bar Chart

All working now !

 

Sorry I'd put cost rather than costs in the formula.

 

Really appreciate your help..............cheers

View solution in original post

14 REPLIES 14
Super User III
Super User III

Re: Sort in Bar Chart

Hi @steveorme69,

 

If you have the values of Income and Cost in the same column create a measure for each one something like:

 

Cost = CALCULATE ( SUM(Table[Value]); Table[Type] = "Cost")

Income = CALCULATE ( SUM(Table[Value]); Table[Type] = "Income")

Then just add the measure or columns in the order you want in your chart. In the example below I'm using columns but it also works with measures as I said:

 

order.gif

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Check out my blog:

Power BI em Português





Super User IV
Super User IV

Re: Sort in Bar Chart

Hi,

 

In the Filter section where you have dragged Income and Costs, drag Income above costs


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

Re: Sort in Bar Chart

Hi Ashish

 

Income and costs are within the same column.

 

hhttps://1drv.ms/u/s!An_LprApKikkdtNLyeO4lZ0n_dUttps://1drv.ms/u/s!An_LprApKikkdtNLyeO4lZ0n_dU

 

Thanks

Steve

steveorme69 Helper I
Helper I

Re: Sort in Bar Chart

Hi Felix

 

Thanks for your reply.  The values for income and costs are in the same column. In fact they are across 2 tables, I have a list of the account codes with balances in a table and then another table to determine whether they are income, costs, assets, liabilities or reserves.

 

E.g. table named "SAGE Trans" contains nominal 4000 which has a value £1,000 and table named "Nominal" holds the list of nominal codes e.g. 4000 and the next column holds the reference "Income".

 

The 2 tables are joined but can't get the measure to work across 2 tables.

 

How did you take the screen video and upload ? as I can show the steps I am going through.

 

Steve

Super User III
Super User III

Re: Sort in Bar Chart

Hi @steveorme69,

 

I assume that both your table are related by account. You have to do the following measures:

 

Cost = CALCULATE(SUM('SAGE Trans'[Value]); Nominal[Reference] = "Cost")

Income = CALCULATE(SUM('SAGE Trans'[Value]); Nominal[Reference] = "Income")

This will give you the expected result and you can then place them in the bar chart by the order you need.

 

But if you want further details please share your steps.

 

It's not a video it's a gif image I taken it with ScreenToGif and it's really simple to use just select the area press record and save the image, then upload it as a photo in your post.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Check out my blog:

Power BI em Português





Super User IV
Super User IV

Re: Sort in Bar Chart

Hi,

 

Share the link from where i can download your PBI file.


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

Re: Sort in Bar Chart

Hi, thanks

 

Still getting the following error

 

https://1drv.ms/f/s!An_LprApKikkbLUKLGWVylqWcMI

 

Thanks

Steve

Super User III
Super User III

Re: Sort in Bar Chart

This is regional setting related change the dot-comma ";" by comma "," everything should work correctly.

 

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Check out my blog:

Power BI em Português





steveorme69 Helper I
Helper I

Re: Sort in Bar Chart

Great that worked but it now groups Income and costs together as follows:

 

https://1drv.ms/u/s!An_LprApKikkfYoQqSGVtpbvn68

 

Thanks

Steve

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors