Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi
I have encountered some problems with the rankx function. I will try to explain it in as much detail as possible.
Two tables; orders & products:
Diagram view
Orders table
Product table
I have constructed measurements as follows:
Total order value:=sumx(Orders;Orders[Qty]*RELATED(Products[Price]))
RankOrder:=rankx(All(Orders);[Total order value]) <= is working
RankProd:=rankx(All(Products);[Total order value]) <= is not working
I tested the formulas in power pivot to present it in a pivot table as per below. As you can see, the rank on items/products is not working properly. Only returning rank 1 for all. I assume this have something to do with the relationships or something, but cannot find out how to solve it.
Result
Any insights would be helpful. Thanks in advance.
best regards
Viktor
Solved! Go to Solution.
Hi @ViktorT
In you pivot table on the right, place Products[ItemID] on the rows instead of Orders[ItemID]
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @ViktorT
In you pivot table on the right, place Products[ItemID] on the rows instead of Orders[ItemID]
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
@AlBthanks alot for your quick reply. Such an irritatingly simple solution 😃
I guess the conclusion is to take care of from which table the ranking value originates from when presenting the data, regardless which table you put the measurement.
cheers
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |