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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
yakolev
New Member

Incorrect Subtotal

Hi PBI Community,

 

I am trying to build a formula that multiplies two columns: sectors flown by KM (kilometers) - so I am testing the different components in the below matrix.

 

Sectors flown sits on a fact table and KMs on a lookup table connected via Route (e.g. Brisbane Melbourne = 1800 KMs)

 

The issue is that - when I drag and drop the KM column into a matrix, I get the category total for each subcategory (e.g. total KMs for the Triangle category 5,670 kms where what I really want to get is the Brisbane - Melbourne segment 1,800 kms (refer red column below).

 

To break down further and access each individual KM range, I have created a measure (blue below) that uses SUMX - however, it sums up each individual instance of the (in this example) the Brisbane - Melbourne segment and adds it up, which is not what I am after.

yakolev_2-1650400869879.png

 

In Excel this would simply be accomplished by creating a new column - with a VLOOKUP formula that looks into a table with route pairs and returns the correct KMs for that pair (row).

 

yakolev_1-1650400313851.png

 

EXTRA: While at it - I have a similar problem with Total Seats column above. Total seats also sits in a related and linked table. Solving the above will also help me solve this problem. However, I just wanted to point out that, interestingly - the amount showing at a row level is the GRAND TOTAL for the whole column - somewhat different to the above case where total at a row level is the CATEGORY total e.g. total for "Triangle", "Regional West", etc. However, for either case I am after the total (which is the actual KMs) at SUBCATEGORY level e.g. city pairs.

 

Thanks, 

 

 

2 REPLIES 2
AllisonKennedy
Super User
Super User

@yakolev  Your tables must be related with 1 to many via route, not category. See if this post helps explain: https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_11.html 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy 

 

Thanks - but fact to lookup tables are related via Routes (please refer screenshot below)

 

The common column in Lookup table is called "One-Way Segment"  but is essentially "Route".

 

yakolev_0-1650441244682.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.