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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors