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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tweidner
Helper I
Helper I

Select number of suppliers and return combination of lowest prices

Good Morning PBI Community,

 

this is already my second attempt to get a solution for the following issue:

 

3 (or unlimited number)  suppliers are submitting prices for 5 (or unlimited number) products.

I'm looking for the lowest prices for the products, but the issue is that not all suppliers are able to provide prices for all products or that a combination of multiple suppliers would be more beneficial.

Idea was to use a filter (selected N records) to determine how many suppliers I would like to use.

 

Results should be:

eg. when selecting 2 (suppliers), the measure or table should return the lowest prices per product by using only 3 suppliers.

Gaps (in case only 1 supplier is selected and this supplier has not submmited prices for all products) can be left blank.

 

Here is how the fact table could look like: (in this example only supplier A has submitted prices for all products)

 

SupplierProduct Price 
A1 $           8.40
A2 $           5.40
A3 $           0.10
A4 $           8.00
A5 $           5.30
B2 $           6.40
B3 $           1.90
B4 $           0.90
C1 $           5.70
C2 $           8.70
C3 $           9.00
C4 $           4.50

 

Result selecting 1 (supplier): Only returns supplier A as this supplier has submitted prices for all products

 

SupplierProduct Price 
A1 $           8.40
A2 $           5.40
A3 $           0.10
A4 $           8.00
A5 $           5.30

 

Result selecting 2 (suppliers): should return max 2 distinct suppliers and lowest prices for all products

 

SupplierProduct Price 
A1 $      8.40
A2 $      5.40
A3 $      0.10
B4 $      0.90
A5 $      5.30

 

I think the key is to look at the lowest total of price calculated by selected N (of allowed suppliers).

 

Very excited to see your ideas!

 

Thanks & Rgds
Tobias

1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

Hi @tweidner 

 

I can see you're trying to set the optimization goal the way I suggested in the previous thread. However, it will not work. This optimization problem causes the so-called exponential explosion and hence it's not something that can be implemented in DAX (technically it can but not in practice). For even small to moderate model sizes, such a calculation will effectively never return.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.