Forum Discussion
Rank Table A according to Table B based on Decreasing Column
- 9 years ago
Hi iamprajot,
The other columns affect the result. Try this formula please. I added another column in the sample.
Measure (or Calculated column) = CALCULATE ( RANKX ( ALL ( 'TableA'[UnitPrice] ), CALCULATE ( SUM ( 'TableA'[UnitPrice] ) ) ), ALLEXCEPT ( TableA, TableA[SupplierID], TableA[UnitPrice] ) )Best Regards!
Dale
Hi,
Rank Column is not actually there, it was a Result View that I showed.
I am afraid I cannot share the actual data, I hope you would understand but I assure you that the two sample tables I showed are exactly identical to what I have here.
Now I have
Table A which have two Columns Supplier ID & Unit Price &
Table B which have Column Supplier ID
Now what I wanted was to Rank Unit Prices according to the Supplier ID weather it is in Table A or Table B.
If I do not Rank it according to Supplier ID then the Unit Price will go on like 1, 2, 3 ......1000 and what I want is that for Supplier ID 1 Ranks should be 1,2,3 and then for Next Supplier ID 2 Rank should be like 1,2,3,4 (Limited to how many times Unit Prices are for a particular Supplier ID)
I think I have explained myself better now and
I am not sure I am going in the right direction or gonna hit a wall again but what I actually wanted was to get 3 Maximum prices for every supplier, that's why I needed to rank them so that I could pick first 3.
Thanks
Hi iamprajot,
The other columns affect the result. Try this formula please. I added another column in the sample.
Measure (or Calculated column) =
CALCULATE (
RANKX ( ALL ( 'TableA'[UnitPrice] ), CALCULATE ( SUM ( 'TableA'[UnitPrice] ) ) ),
ALLEXCEPT ( TableA, TableA[SupplierID], TableA[UnitPrice] )
)
Best Regards!
Dale
- iamprajot9 years ago
Responsive Resident
Remarkable !
Thanks