cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Smackcat
Helper I
Helper I

Order matrix columns by a column that exists on another table

Hi experts.

 

I have two tables:

 

Table1:

StatusAmount
Nice100
Bad50

 

Table2:

NameStatus
MariaNice
MarioBad

 

I'm using Table2 to get a matrix, and I want to order its rows with the Amount column in an ascendent order, not the Status column. So my result would be:

NameStatus
MarioBad
MariaNice

 

But I do not want to show the Amount column on the matrix. Any advice would be appreciated. Thanks

 

Pd: I want to add that I can't use the option "order by another column" on table 1 because they have multiple values according to the Amount column. They're unique values per country though

 

Table1:

StatusAmountCountry
Nice100USA
Bad50UK
Nice60UK
Bad120USA
1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @Smackcat ,

 

I'm not sure the relationship between table 1 and table 2, but preferably there is a one to one relationship between them. So I add an index column into both tables.

 

This is my test table 1:

vyadongfmsft_0-1668136468413.png

 

Table 2:

vyadongfmsft_1-1668136495432.png

 

Create a new column in table 2:

 

Amount = LOOKUPVALUE('Table 1'[Amount],'Table 1'[Index],'Table 2'[Index])

 

 

Sort ascending for amount column:

vyadongfmsft_0-1668143764861.png

 

 

Create a matrix and it will sort by amount column:

vyadongfmsft_1-1668143788576.png

 

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yadongf-msft
Community Support
Community Support

Hi @Smackcat ,

 

I'm not sure the relationship between table 1 and table 2, but preferably there is a one to one relationship between them. So I add an index column into both tables.

 

This is my test table 1:

vyadongfmsft_0-1668136468413.png

 

Table 2:

vyadongfmsft_1-1668136495432.png

 

Create a new column in table 2:

 

Amount = LOOKUPVALUE('Table 1'[Amount],'Table 1'[Index],'Table 2'[Index])

 

 

Sort ascending for amount column:

vyadongfmsft_0-1668143764861.png

 

 

Create a matrix and it will sort by amount column:

vyadongfmsft_1-1668143788576.png

 

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HoangHugo
Solution Specialist
Solution Specialist

Hi, I think if can not use " "order by another column", you must put Amount column into your matrix to make sort. You can narrow the Amount column, change its color format to be invisble.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors