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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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