cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Sort by value

Hi dear, 


I have three independent tables , that is, no relationships between them.
Each table has a column and I created a bar graph with them and I want to order it by value.

 

 

Capturar.JPG

 

Thanks 

Wneiton

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: Sort by value

i hope this could help you visual.

old situation:

you have 4 separte measures

 

1 old situation.PNG

create a separte table for the legend. 


2 table.PNG

 

 

 

 

 

 

 

 

 

create a switch that combine your measure to the table. 

it would look like this.switch =

VAR Legend = SELECTEDVALUE(Table1[Column1])
RETURN 
SWITCH(TRUE();
    Legend = "Proposta2"; [Measure 2] ;
    Legend = "Proposta3"; [Measure 3];
    Legend = "Proposta4"; [Measure 4])

in table.PNG

 

 

 

 

 

 

 

 

Now you have 1 measure that you can sort. 

choose you visual and i think you are done. 
sort chart.PNG

 

 

 

 

 

 

 

 

 

change your setting in the colors if you want every measure to be a differnt colour. 

change colors.PNG

 

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Sort by value

Yes @Maddy99

 

Thanks for help, I've slightly changed a dax formula.

 

switch = SWITCH(Teste[Column1];"proposta1";[Media_Impacto1];"proposta2";[Media_Impacto2];"proposta3";[Media_Impacto3])

 

 

Teste = Table Name 

Media_Impacto = my measure from different tables (no relationships tables)

View solution in original post

8 REPLIES 8
Highlighted
Super User IV
Super User IV

Re: Sort by value

I don't believe that you can do that dynamically but you could do it manually by changing the order in the Value area.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Highlighted
Resolver II
Resolver II

Re: Sort by value

intresting question. 

for order value you must get 1 value. 

and ofcours you want 3 category. 

 

make a separte table with 3 rows. ever row has a text that repesent a category.

this column you can use in the legend. 

 

then make a measure with a swithc. 

when category = A then measure A

category = B then measure B.

 

i think this could help. 

Highlighted
Super User IV
Super User IV

Re: Sort by value

What @Maddy99 is talking about is the Disconnected Table Trick. Here is an article that discusses it:

 

In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Highlighted
Resolver I
Resolver I

Re: Sort by value

@Maddy99 

@Greg_Deckler

 

I created a table with 3 rows. 

 

Capturar.JPG

 

when I try to drag this table's column to the visualization, it's not possible! 

 

Capturar2.JPG

 

Sorry, but I didn't understand where and how to create this measure. 

Highlighted
Community Support
Community Support

Re: Sort by value

@wneiton,

 

You could also use Append Queries (Table.Combine) in Query Editor or UNION Function (DAX) to create a new table.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Resolver II
Resolver II

Re: Sort by value

i hope this could help you visual.

old situation:

you have 4 separte measures

 

1 old situation.PNG

create a separte table for the legend. 


2 table.PNG

 

 

 

 

 

 

 

 

 

create a switch that combine your measure to the table. 

it would look like this.switch =

VAR Legend = SELECTEDVALUE(Table1[Column1])
RETURN 
SWITCH(TRUE();
    Legend = "Proposta2"; [Measure 2] ;
    Legend = "Proposta3"; [Measure 3];
    Legend = "Proposta4"; [Measure 4])

in table.PNG

 

 

 

 

 

 

 

 

Now you have 1 measure that you can sort. 

choose you visual and i think you are done. 
sort chart.PNG

 

 

 

 

 

 

 

 

 

change your setting in the colors if you want every measure to be a differnt colour. 

change colors.PNG

 

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Sort by value

Yes @Maddy99

 

Thanks for help, I've slightly changed a dax formula.

 

switch = SWITCH(Teste[Column1];"proposta1";[Media_Impacto1];"proposta2";[Media_Impacto2];"proposta3";[Media_Impacto3])

 

 

Teste = Table Name 

Media_Impacto = my measure from different tables (no relationships tables)

View solution in original post

Highlighted
Resolver II
Resolver II

Re: Sort by value

Yes that works to. 

i am happy that i could help. 

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors