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

How to change the ranking based on the values of 2 columns fields in a Matrix table

I have a Matrix table with the following setting

 

Rows: Customer

Columns: Year

Value: Sales Amount

 

I set a visual filter based on Top 20 Customer By Sales Amount as shown below;

 Matrix_Sample.jpg

 

How can i set the ranking based on year 2018?

 

Currently, the ranking is based on the total value of year 2016 + 2017 + 2018.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

Hi,

 

Finally, managed to do that using the formula you provided. 

 

I need to put the Rank field after the Sales value and sort it ascending. Then hide the entire Rank column and it works!

 

Thanks.

View solution in original post

7 REPLIES 7
Highlighted
Super User III
Super User III

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

@roytap

 

Try this MEASURE

RANK =
RANKX (
    ALLSELECTED ( TableName[Customer] ),
    CALCULATE ( SUM ( TableName[SalesAmount] ), TableName[Year] = 2018 ),
    ,
    DESC,
    DENSE
)
Try my new Power BI game Cross the River
Highlighted
Helper I
Helper I

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

But how do i sort by using this Rank?

 

The sort by column is disabled when i highlight this meansure in my query list, 

 

Thanks.

Highlighted
Super User III
Super User III

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

@roytap

 

Are the rankings correct?

 

Could you show a screenshot? I want to understand what exactly is the sorting problem?

Try my new Power BI game Cross the River
Highlighted
Helper I
Helper I

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

Yes, the ranking seems to be correct, but i am unable to sort it accordingly based on the rank as shown below:

Matrix_Sample2.jpg

Highlighted
Helper I
Helper I

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

HI,

 

Any idea how I can sort the Matrix table by year 2018? I am still unable to find any way that it can be sorted by year 2018. By deafult, it will automatically be sorted by the total aggregation of the year value.

Highlighted
Super User III
Super User III

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

Hi @roytap

 

I tried it as well..

 

I am unable to sort in a Matrix too Smiley Sad

 

May be you can use a TABLE visual

Try my new Power BI game Cross the River
Highlighted
Helper I
Helper I

Re: How to change the ranking based on the values of 2 columns fields in a Matrix table

Hi,

 

Finally, managed to do that using the formula you provided. 

 

I need to put the Rank field after the Sales value and sort it ascending. Then hide the entire Rank column and it works!

 

Thanks.

View solution in original post

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors