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
mbacicci
Helper I
Helper I

Help in consolidating data

Hi, I would need some help on the below.


I have a PBI report connected to the Database and showing invoicing data. The tables are: -invoices -products -customers.


Everything is linked and working fine. Now I need to integrate the report with other invoicing data from a new portfolio but I'm facing some issues because not all product and customer IDs are in the database.

As a consequence, when I build the relationship between the tables I get lower values.


What would you suggest in this case?


I'm already using the below calculated measures to SUM the total of invoiced amounts from the Database (which has two different invoicing tables).

 

Total Invoice Amount =
SUMX(
SUMMARIZE(
'Fact_Invoice',
'Fact_Invoice'[invoice_id],  
"Amount_EUR", SUM('Fact_Invoice'[Amount_in_EUR])
),
[Amount_EUR]
) +
SUMX(
SUMMARIZE(
'Fact_Invoice_SAP',
'Fact_Invoice_SAP'[invoice_id],
"Amount_EUR",SUM('Fact_Invoice_SAP'[Amount_in_EUR])
),
[Amount_EUR]
)

 

2 REPLIES 2
mh2587
Super User
Super User

//Use LEFT OUTER JOINS in PQ to just get the matching data and try the following measure
Total Invoice Amount =
SUMX(
   SUMMARIZE(
      'Fact_Invoice',
      'Fact_Invoice'[invoice_id],  
      "Amount_EUR", SUM('Fact_Invoice'[Amount_in_EUR])
   ),
   IF(
      NOT(ISBLANK(RELATED('Products'[product_id]))),
      [Amount_EUR]
   )
) +
SUMX(
   SUMMARIZE(
      'Fact_Invoice_SAP',
      'Fact_Invoice_SAP'[invoice_id],
      "Amount_EUR",SUM('Fact_Invoice_SAP'[Amount_in_EUR])
   ),
   IF(
      NOT(ISBLANK(RELATED('Products'[product_id]))),
      [Amount_EUR]
   )
)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Yes sorry maybe the question was a bit confusing. This measure works well for the 2 tables because all product and customer IDs are in the database.

 The new table I'm trying to integrate contains everything in there: dates, amounts, customers and products. Customers and products are new values which are not in the database.

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.