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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

sum per catagory, rank and create sceanrio

Hi,

 

I have a query with different offers (1 value column) per shipment, In de data I've also a shipping point

I want to create a scenario where I see the Best 2 carriers per shipping point. Whereafter I want to see a scenario what the split of the carriers would be per shipping point. Any ideas how I should start?

 

I was able to create a rankx, but after that I got stuck

 

Annotation 2019-02-05 231730.jpg

4 REPLIES 4
moumipanja
Employee
Employee

As per your description of the problem, I assumed there are 2 parts of the probable solution. The cost requirement of being best is just my assumption and can be decided on your business requirements.

 

1. Best 2 carriers per shipping point offering lowest cost

2. Best 2 shipping points per carrier offering highest cost

 

Solution:

1. Best 2 carriers per shipping point offering lowest cost

1.JPG

 

Create the following 2 measures 

 

Cost min per Shipping Point = 
MINX(
	KEEPFILTERS(VALUES('Sheet1'[Shipping Point])),
	CALCULATE(MIN('Sheet1'[Cost]))
)

 

 

Rank min first = RANKX(ALL(Sheet1[Carrier]),[Cost min per Shipping Point],,ASC)

 

 

Set your visual level filter for Rank min first measure -> select 'is less than' and set the value as 3

1.JPG

 

 

2. Best 2 shipping points per carrier offering highest cost

1.JPG

 

 

Create the following 2 measures 

Cost max per Carrier = 
MINX(
	KEEPFILTERS(VALUES('Sheet1'[Carrier])),
	CALCULATE(MAX('Sheet1'[Cost]))
)
Rank max first = RANKX(ALL(Sheet1[Shipping Point]),[Cost max per Carrier],,DESC)

Set your visual level filter for Rank max first measure -> select 'is less than' and set the value as 3

1.JPG

Anonymous
Not applicable

Great,

Although I forgot 1 item

Not aal carriers offered every shipments per shipping point, I would like to add a extra filter on % that they have quoted like table below

 any idea?

 

Shipment carrierShipping pointCostkg
1ANew york55
2ALA1710
3AMiami165
4ABoston1210
5ABoston1080
6ABoston10500
7ABoston2211
8ANew york1015
9ALA127000
10AMiami22540
1BNew york245
2BLA1610
3BMiami195
4BBoston 10
5BBoston 80
6BBoston15500
7BBoston2411
8BNew york1815
9BLA257000
10BMiami10540
1CNew york55
2CLA1810
3CMiami145
4CBoston1710
5CBoston 80
6CBoston21500
7CBoston611
8CNew york815
9CLA97000
10CMiami12540
1DNew york65
2DLA2410
3DMiami145
4DBoston 10
5DBoston1180
6DBoston8500
7DBoston1011
8DNew york2115
9DLA87000
10DMiami24540

@Anonymous Could you please elaborate a little more on what you would want to find from the table you posted above? I am afraid I didn't quite understand your question.

Anonymous
Not applicable

Hi, 

 

Thx Sorry, 

Some carriers didn't offered all the shipments per loading location, this because they are interested in that kind of shipments.

Therefore I would like to set first a filter on % that they made a offer for.

for example they neeed to at least offer 95% of all the shipments leaving that loading location before i would like to consider them for the best 1 or 2 in the ranking

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.