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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to show specific values of the data in a lookup table instead of total sum in dax measure?

Hi guys,

 

Im a beginner that is a bit stuck with probably something simple. I think im using the wrong function but I managed to only find the ones that didn't work. Hope some one can help!

 

I have a lookup table (truck capacity) where I have all truck numbers and the belonging loading capacity. So:

Truck number - Loading capacity

Truck 1 - 3,0 

Truck 2 - 5,0

Truck 3 - 12,0

 

Than I have a data table (routes) where I have all truck numbers by days, truck number and loading meters. So:

Date - Truck number - Loading meters

1-1-20 - Truck 1 - 1,8

1-1-20 - Truck 2 - 4,0

1-1-20 - Truck 3 - 9,2

2-1-20 - Truck 1 - 2,4

2-1-20 - Truck 2 -  2,0

2-1-20 - Truck 3 - 10,6

 

My look up table has a relationship with the data table by truck number. That having said.

My end goal is to divide loading meters by loading capacity for each truck by route by day.

I already have the measure for the loading meters using sum('routes'[Loading meters]).

 

Now my next step is to have a measure for loading capacity. I tried:

- SUM('truck capacity'[Loading capacity])

and

- CALCULATE(

SUM('truck capacity'[Loading capacity]),

VALUES('truck capacity'[Truck number])

)

 

My problem is that it now shows the total sum of the three truck numbers as values (20,00), no matter for what truck number I want to use it. So basically its summarized but I want the loading capacity per truck. Can someone tell me what my correct measure is for loading capacity based on truck number instead of what I have now done to show the total loading capacity of all trucks...

 

Thanks in advance! Grtz Jeroen

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Managed to solve my problem. 

Everything with the DAX calculation was okay.

Made the rookie mistake of using the licenseplate of my data table instead of using the licenseplate of my look up table. When I changed them it was working correctly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Managed to solve my problem. 

Everything with the DAX calculation was okay.

Made the rookie mistake of using the licenseplate of my data table instead of using the licenseplate of my look up table. When I changed them it was working correctly.

rfigtree
Resolver III
Resolver III

Hi I think this is what you mean, you will need to expand your fact table to include route and have an entry for each trip otherwise you will get wonky results.

 

Think it is right, gives you ideas anyway.

 

Dont know how to save file here so pictures will have to do.

 

rfigtree_0-1612076106830.png

 

rfigtree_1-1612076136925.pngrfigtree_2-1612076167633.png

 

 

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.