cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JollyRoger01
Helper III
Helper III

How to use SUMPRODUCT (SUMX) in a calculated column for one related and one unrelated table? (Excel)

I have three tables and I can only relate two of them together due to circular references errors I get when trying to relate the other. I have tried to explain my goal as I've been writting this post but I think it is easier to simply show a desired output in a file.

 

I am looking for a formula to write in the Changes calculated column of Table 3 that gives me the desired output as shown in the worksheet. Please note this is a simplified version of my actual data and I can't change the relationship structure.

 

Book1 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@JollyRoger01 

Add the following calculated column: I attached the file below my signature.

Changes = 
SUMX(
    FILTER(
        Resource,
        Resource[System] = EARLIER(System[System] )
    ),
    Resource[Changes] * 
    MAXX(
        FILTER(
            'Weight',
            'Weight'[Resource] = Resource[Resource] 
        ),
        'Weight'[Weighting]
    )
)

Fowmy_0-1626756771367.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@JollyRoger01 

Add the following calculated column: I attached the file below my signature.

Changes = 
SUMX(
    FILTER(
        Resource,
        Resource[System] = EARLIER(System[System] )
    ),
    Resource[Changes] * 
    MAXX(
        FILTER(
            'Weight',
            'Weight'[Resource] = Resource[Resource] 
        ),
        'Weight'[Weighting]
    )
)

Fowmy_0-1626756771367.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Worked like a charm, thank you! Out of interest, is this a common occurance and common solution?

Jihwan_Kim
Super User
Super User

Picture1.png

 

Changes Measure : =
SUMX (
RELATEDTABLE ( Changes ),
Changes[Changes] * RELATED ( Resources[Weighting] )
)

 

https://www.dropbox.com/s/vyr52v7c4h9012r/jolly.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you, however as I pointed out I cannot use a relationship to the Resources table as you have outlined. My actual relationship tree is quite complicated and it doesn't allow for a relationship to that table, so I must call it another way.

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors