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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Teukuario
New Member

Rankx measure Problem

Hi anyone, 

 

Please help to fix my problem,

I have data something like this,

Teukuario_0-1649570676416.png

 

and i want to compute rank based on EBIT data per msc,

instead of computed by msc, the rank goes by desc (GL desc),

how to go beyond the desc for the rank based on Total EBIT per msc

so the rank should be "1" all the way down.

 

 

Teukuario_1-1649570804391.png

 

here is the measure that i use:

Rank =
RANKX(ALL(TowerMaster[msc]),[Total EBIT],,DESC)
 
Thank you,
 
Best Regards

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Teukuario 

 

When using the RANKX measure you need to use the CALCULATE for the value you want to have ranked in this case try to redo your measure to:

 

Rank =
RANKX(ALL(TowerMaster[msc]),CALCULATE([Total EBIT]),,DESC)

 

Check this blog post with a complete explanation of the why of the use of calculate within this function.

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures


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





View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Teukuario 

Could you provide some information? Thanks.

 (1) a sample file, you can replace raw data with bogus data to protect your privacy.

     or provide some sample data that fully covers your issue/question.

(2) give your expected result and its math formula based on the sample you provide.

 

Best Regards,

Community Support Team _Tang

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

MFelix
Super User
Super User

Hi @Teukuario 

 

When using the RANKX measure you need to use the CALCULATE for the value you want to have ranked in this case try to redo your measure to:

 

Rank =
RANKX(ALL(TowerMaster[msc]),CALCULATE([Total EBIT]),,DESC)

 

Check this blog post with a complete explanation of the why of the use of calculate within this function.

https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures


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





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.