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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
BlueGorilla
Regular Visitor

Calculating total cost from various tables based on filtered values

Hi 

 

I've been trying to solve this for the past coulple of days, but unsuccessfully. I've got the following 3 tables:

- table "Items Dimensions" with Items and their dimentions

- table "Supplier ABC"  for services 1 and 2 for the years 2020 and 2021 where the rates are based on the product of the dimentions (L x W x H) from the 1st table

- table "Supplier XYZ" for service 3 for the years 2020 and 2021 where the rates are based on the item length (from 1st table), as well as origin and destination

 

BlueGorilla_3-1647601487147.png

 

What I'm trying to achieve is when I select Item ID from the 1st table, as well as the Origin and Destination from the 3rd table - to get the corresponding rates for services 1, 2 and 3 in 2020 and 2021 and to be able to build a stacked column chart that will show each cost in the two years.

 

ITEM DIMENSIONS TABLE

 

Item IDLengthWidthHeightL x W x H
A1001055,000
B150151022,500
C200202080,000
D200202080,000

 

SUPPLIER ABC

 

YearServiceL x W x H FromL x W x H ToRate
2020Service 1050,000 $     1,000
2020Service 150,001100,000 $     2,000
2020Service 2050,000 $     3,000
2020Service 250,001100,000 $     3,500
2021Service 1050,000 $     1,700
2021Service 150,001100,000 $     2,900
2021Service 2050,000 $     3,400
2021Service 250,001100,000 $     5,000

 

SUPPLIER XYZ

 

YearServiceLength FromLength ToOriginDestinationRate
2020Service 30100Location 1Location 2 $ 100
2020Service 3101200Location 1Location 3 $ 400
2020Service 3201400Location 1Location 4 $ 600
2020Service 30100Location 2Location 1 $ 100
2020Service 3101200Location 2Location 3 $ 300
2020Service 3201400Location 2Location 4 $ 700
2021Service 30100Location 1Location 2 $ 220
2021Service 3101200Location 1Location 3 $ 540
2021Service 3201400Location 1Location 4 $ 760
2021Service 30100Location 2Location 1 $ 210
2021Service 3101200Location 2Location 3 $ 350
2021Service 3201400Location 2Location 4 $ 910

 

Can anyone, please, help with this, as I can't wrap my head around how to solve it...

 

Many thanks! 

 

 

 

 

 

 

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @BlueGorilla ,


As @lbendlin  said, your description does not correlate well with the three tables provided to know the exact inter-table relationships.

How to Get Your Question Answered Quickly - Microsoft Power BI Community


Best Regards,
Henry

 

lbendlin
Super User
Super User

There is no obvious way to control the SUPPLIER ABC fact table from the SUPPLIER XYZ fact table.  So your statement:  " when I select Item ID from the 1st table, as well as the Origin and Destination from the 3rd table" is not something that is supported by your data model.  Please reconsider your requirement or provide more details.

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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