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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Ranking

Hi there,

 

This is my very first post here in the community, so I hope I'm doing it in the right way 🙂

 

I need some help with creating a dax formula for the table "Commodity" , that shows the rank for "Physical Commodity" based on the "Contracted Quantity", ignoring the impact of the "Date", like below:

Gerogi27_0-1697314033329.png

"Contracted Quantity" is a measure, and "Date" and "Physical Commodity" are part of different tables.

Can you give me some suggestions? 

 

Thanks

 

6 REPLIES 6
Dangar332
Super User
Super User

hi, @Anonymous 

try below measure  

rank1 =
RANK(SKIP,ALL('rank'),ORDERBY('rank'[contracted quantity],ASC))

Dangar332_0-1697611327323.png

 

Anonymous
Not applicable

@Dangar332  @Jihwan_Kim  thanks for trying.

 

I manage to solve it with Calculate and All functions.

 

Have a nice day!

Dangar332
Super User
Super User

hi,  @Anonymous 

 

adjust your table name
try below one
result =
var a = SUMMARIZECOLUMNS('physical commodity'[physical commodity],"cont commodity",[contracted commodity])

var b = SELECTCOLUMNS(a,"rankcomparing",[cont commodity])
return 

rankx(b,[rankcomparing],[Contracted Quantity])

 

'physical commodity' -- is your table name so adjust it .

[Contracted Quantity]  -- is your measue

Anonymous
Not applicable

Hi @Dangar332,

 

[contracted commodity] from variable "a", I believe should be "contracted quantity", right?

In the form with "contracted quantity" the formula does not show anything 😞

Thanks

 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1697345598462.png

 

Jihwan_Kim_1-1697345750203.png

 

 

Contract Qty: = 
SUM( sales[Contracted Quantity] )

 

Ranking by physical commodity = 
RANK (
    SKIP,
    ALL ( 'Physical Commodity'[Physical Commodity] ),
    ORDERBY ( [Contract Qty:], DESC )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim ,

 

Thanks for the suggestion, but it does not work 😞

If I add "Date" to the the table it's messing up with the rank.

 

Thanks,

Georgiana

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.