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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MercedesAlpha1
Regular Visitor

Visualisation not showing correct results from multiple tables

Hi, so im reletively new to powerbi but seem to be making good ground.

 

However I have an issue where im trying to have a visual bring back results from two different tables

 

Ive screenshot the relationships below. Basically Im looking to have a table visualisation which shows the category and the the contract value and the amount spent against the contract. The Contracts are in the register and the spend in the spend table. To link them I had to create a intermidary table which had the supplier account code which is in both tables multiple times (I could link the tables directly because of this as multiple contracts have the same supplier account code and multiple invoices are listed in the spend table with the account code.

 

In the output example below im taking the category level 1 field from the contracts table, the total contract value from the contracts table and the amount excluding vat from the spend table. However the figure reported from the spend table is the total for all invoices.

 

How do i correct this so i can see the contract value and spend by category?

 

Thanks

 

 

Relationships.pngResults.png

1 ACCEPTED SOLUTION

In the example I provided:

Measure 32 =
var _supplier = MAX('Table (42)'[Supplier]RETURN
CALCULATE(SUM('Table (41)'[Value]),'Table (41)'[Supplier]=_supplier)

Here we take the supplier information from one table and use it to calculate the corresponding value from the other.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

Use calculate and modify the filter context:

Example tables:

ValtteriN_0-1722595982714.png

ValtteriN_1-1722596077197.pngValtteriN_2-1722596220782.png

Simple sum won't work:

ValtteriN_3-1722596366660.png

 


However this will work:

Measure 32 =
var _supplier = MAX('Table (42)'[Supplier]) RETURN
CALCULATE(SUM('Table (41)'[Value]),'Table (41)'[Supplier]=_supplier)
ValtteriN_4-1722596426510.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Apologies if a simple question but how to you modify the filter context?

In the example I provided:

Measure 32 =
var _supplier = MAX('Table (42)'[Supplier]RETURN
CALCULATE(SUM('Table (41)'[Value]),'Table (41)'[Supplier]=_supplier)

Here we take the supplier information from one table and use it to calculate the corresponding value from the other.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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