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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Higgs11
Frequent Visitor

Summarizing amount from two tables that do not have uniqe primary keys

Hello all, I need to summarize the Asset Cost for each project number using two data sets. the data sets have multiple rows for each project costs.

The "main Table" has the "Project Numbers". and can show up on multiple rows.

 

The "Table 2" also has "Project Numbers" and has the "Asset Costs" needed to summarize. This table also has multiple rows for "Project Numbers"

 

I am thinking of using a PBI Matrix table and dropping the "Project Numbers" in "Rows" and then dropping the DAX Measure created here in "Values.

 

 

PBI Q.jpg

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Higgs11

 

Does that meet your requirement?

Table 2 = 
VAR a =
    ADDCOLUMNS (
        SUMMARIZE (
            'Main table',
            'Main table'[Project ID],
            'Main table'[Project Number]
        ),
        "id", 'Main table'[Project Number]
    )
RETURN
    ADDCOLUMNS (
        a,
        "c", CALCULATE (
            SUM ( 'Table'[Asset Cost] ),
            FILTER ( 'Table', 'Table'[Project No] = [id] )
        )
    )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Higgs11

 

Does that meet your requirement?

Table 2 = 
VAR a =
    ADDCOLUMNS (
        SUMMARIZE (
            'Main table',
            'Main table'[Project ID],
            'Main table'[Project Number]
        ),
        "id", 'Main table'[Project Number]
    )
RETURN
    ADDCOLUMNS (
        a,
        "c", CALCULATE (
            SUM ( 'Table'[Asset Cost] ),
            FILTER ( 'Table', 'Table'[Project No] = [id] )
        )
    )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors