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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MarkShu
Helper I
Helper I

Sum of ranks by several columns

Hello! 

I want sort my ADs by sum of ranks Spending + Bounce Rate and show up with all another atributs: Source, Ad Campaign, Ad Group, Key Word. I already broke my head trying to figure out how to do it. Can you help me? 


хостинг изображений

13 REPLIES 13
Nolock
Resident Rockstar
Resident Rockstar

Hi Mark,

if I unterstood you well, you need a rank on an expression which is a sum of ranks on two other columns. If it is so, check my solution.

 

Rank by Bounce Rate - I think you already have this part.

Rank by Bounce Rate = 
RANKX(TestTable; TestTable[Bounce Rate];;ASC)

Rank by Spendings - the same as Bounce Rate.

 

Rank by Spendings = 
RANKX(TestTable; TestTable[Spendings];;ASC)

And the last one uses the same function RANKX, but as an expression for sorting is a sum of those two ranks.

Rank by Sum = 
RANKX(TestTable; TestTable[Rank by Bounce Rate] + TestTable[Rank by Spendings];;ASC)

 

Unfortunately it does not working at all. =( Screenshot_3.jpgзагрузить фото,загрузить картинку

Nolock
Resident Rockstar
Resident Rockstar

Hi Mark,

 

please check the screenshot and tell me, if the output is the result you expect.

In the last column you see the value which is used for the final ordering.

Thanks 🙂

 

Annotation 2019-02-25 110748.jpg

Rank by Bounce Rate is also very strange. 

Screenshot_4.jpg

There is a problem: Rank by spendings is 1 everythere. 

Nolock
Resident Rockstar
Resident Rockstar

Hmm, I see, then please send me the formula you use for the calculation of the Rank by spendings.

Rank by Spendings =
RANKX('А'; SUM('А'[Spendings]);;ASC) 
Nolock
Resident Rockstar
Resident Rockstar

Aha, please remove the SUM from your formula. You want to rank by the row value of the column, not by a SUM of values in a column.

But I want to rank by sum (there are many dates and rows can be))) 

And with calculates it also does not working.  

Screenshot_5.jpg
Nolock
Resident Rockstar
Resident Rockstar

And what is the grouping column which you would like to have for summing of groups?

For all atributes. Eventually I want see rating from most important to less important ads for ads with the largest spendings and bounce rate.

Nolock
Resident Rockstar
Resident Rockstar

Could you please write an SQL for that? Maybe after that it'll be clearer what are your expectations.

Thanks 🙂

I can't give you SQL, but I have broad table like this  https://dropmefiles.com/S9djd 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.