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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ArlenioPaiva
New Member

Help with Maxx and RANKX

Hi guys, I need some help to solve this problem. I want that the variable MaxRank returns the maximun value of variable rankeamento1.
How could i do that? I've tried many ways to put the right result but with no succes. My objetive is that rows that aren't between the LS and LI must be classified as the last one in this rank. Any idea how to solve that?

var Desvio = STDEVX.P(ALLSELECTED(fStatusInvest),[Total CAGR RECEITAS])


var Media = AVERAGEX(ALLSELECTED(fStatusInvest),[Total CAGR RECEITAS])

var Multiplo = [Total CAGR RECEITAS]

var LS = Media + 2.5*Desvio

var LI = Media - 2.5*Desvio

var rankeamento1 =
RANKX(
FILTER(
ALLSELECTED(fStatusInvest),
[Total CAGR RECEITAS] <= Media + 2.5*Desvio &&
[Total CAGR RECEITAS] >= Media - 2.5*Desvio &&
[Total CAGR RECEITAS] <> BLANK()),
[Total CAGR RECEITAS],
,
DESC,
Dense
)

var MaxRank = Maxx(fStatusInvest, rankeamento1)

Return IF(
Multiplo = BLANK(),
BLANK(),
IF(
Multiplo >= LS || Multiplo <= LI,
MaxRank,
rankeamento1
)
)


8 REPLIES 8
v-janeyg-msft
Community Support
Community Support

Hi, @ArlenioPaiva 

 

Have your problem been solved? @MFelix said is reasonable. If you still need help, Can you share some sample fake data and your desired result?So we can help you soon.

 

Best Regards

Janey Guo

So, i havent solved yet.

 

I will share with you, if you can help i will appreciate.

How can i share? I tried here, but with no success

MFelix
Super User
Super User

Hi @ArlenioPaiva ,

 

your explanation is not very clear about your data however believe that you need to do a summarize on your maxrank instead of linking the table directly something similar to this:

 

MaxRank =
MAXX (
    SUMMARIZE ( fStatusInvest, fStatusInvest[Column], "@Rankeamento", rankeamento1 ),
    [@Rankeamento]
)

 

Be aware that since I don't know your data granularity I only used a column but you must include in the summarize all the columns that make part of your context.

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



First of All, thank you for your tentative.

But i didnt have success with it.

 

Could i share my project with you to see the problem?

 

thank you

Hi @ArlenioPaiva ,

 

Please do.

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



https://drive.google.com/drive/folders/18JrGxpcVXwrAshdCDWtv1XM_i1e_Rdun?usp=sharing

 

here is the link with files guys.

Could someone help me?

 

I'm not able to solve the problem until now

Hi, @ArlenioPaiva 

 

I checked your file, and found that you seem to have solved this problem, right?

Is this result you want, do you still need help?

12.png

 

Best Regards

Janey Guo

I solved the problem but i dont know if i have solved it correctly. But thanks for your help

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors