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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PietroP
New Member

Wrong column total relationing two tables

Hi everyone,
i have two tables:

 

table1:
SiteCode,

Work_ID,
Date_Of_Work

 

ex:

work_IDSiteCodedate_of_work
2021CF000030D0312511/03/2021 00:00
2019CF000017D0001919/09/2019 00:00
2019CF000089D0237004/12/2019 00:00
2020CF000023D0245429/01/2020 00:00
2019CF000074D0233615/11/2019 00:00
2019CF000098D0239816/12/2019 00:00
2020CF000034D0261521/02/2020 00:00
2020CF000104D0283504/08/2020 00:00
2020CF000019D0167931/01/2020 00:00
2020CF000018D0244528/01/2020 00:00
2020CF000020D0154331/01/2020 00:00

 

 

table2:

SiteCode,
TOTKW

 

Ex:

SiteCodeTOTKW
D03125950
D00019948
D02370576
D02454491
D02336300
D02398250
D02615249
D02835222
D01679215
D02445200
D01543150

 

I made a relationship many-to-one between the two tables (table1 to table2) on SiteCode and I need to get a table with SiteCode, Work_ID, Date_Of_Work, and TOTKW

wrong_total.jpg

 

The problem is that TOTKW field total is not the sum of the row values displayed.
I tried to solve creating a new column in table two with this formula:

NewColumn = calculate (sumx(Table2,Table2[TotKW]) )
But it didn't work

Can you please hel me?

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@PietroP 

You may just create a column in Table 1 to get the TOTKW from table2, this should be more clear to you.

TOTKW = Related(table2[TOTKW])

 

Then you can just create measure or column with simply sum.
measure = sum(table1[TOTKW])

 

 

Best regards
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@PietroP 

You may just create a column in Table 1 to get the TOTKW from table2, this should be more clear to you.

TOTKW = Related(table2[TOTKW])

 

Then you can just create measure or column with simply sum.
measure = sum(table1[TOTKW])

 

 

Best regards
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi @PietroP 

 

Try this:

 

Measure = sum('Table 2'[TOTKW])
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!


amitchandak
Super User
Super User

@PietroP , Try like

NewColumn = calculate (sumx(values(Table2[Sitecode]),calculate(Max(Table2[TotKW]) )))

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for your suggestion. It didnt work, I still have the same total.

I updated my first post pasting real datas about the two tables. Hope it could help.

Tell me if you need anything different.

Thanx

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.