The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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:
"Contracted Quantity" is a measure, and "Date" and "Physical Commodity" are part of different tables.
Can you give me some suggestions?
Thanks
hi, @Anonymous
try below measure
@Dangar332 @Jihwan_Kim thanks for trying.
I manage to solve it with Calculate and All functions.
Have a nice day!
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
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
Hi,
Please check the below picture and the attached pbix file.
Contract Qty: =
SUM( sales[Contracted Quantity] )
Ranking by physical commodity =
RANK (
SKIP,
ALL ( 'Physical Commodity'[Physical Commodity] ),
ORDERBY ( [Contract Qty:], DESC )
)
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
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
12 | |
9 | |
7 |