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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

New column for SUM based on a value in another column

Need to combine PO Hours for PO Lines 1 and 2 into a new column. See visual.

Sum Rows.JPG

 

Total Summed Rows.JPG

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I figured it out - just fyi. When I created the new table as instructed to SUM both PO Lines and eliminate the PO Line 2 rows to prevent it from showing two visuals for one person, it did not have the director column. I added the director column from the original data file using by adding it the following formula that was used to create the new POLineTotal table and it worked. Thank you everyone -Yuliana, Frank, and Greg - for your help. Takes a village.

POLineTotal = SUMMARIZE(FY19RemainingHoursReport,FY19RemainingHoursReport[Director],FY19RemainingHoursReport[Contractor, PO, End Date],"Total PO Hours",SUM(FY19RemainingHoursReport[ PO Hours]))

View solution in original post

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

One simple solution is adding [Contractor] and [PO Hours] into a table visual.

1.PNG

 

Alternatively, you can create a calculated table.

result table = SUMMARIZE(Table1,Table1[Contractor],"Total PO Hours",SUM(Table1[PO Hours])) 

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you,

In my first table, 'FY19', I created a column for every month of the year by subtracting the number of hours available to work in each month. After the month is over, I will get new data and subtract the number of hours worked. I used this in a clustered column chart.

This is how I created September which is the first month in the fiscal year.

01Sep 2018 Remaining Hours = 'FY19'[POHours]-152

 

Subsequent months use the previous month's hours left to subtract hours avaliable or worked as shown for October below.

02Oct 2018 Remaining Hours = 'FY19'[01Sep 2018 Remaining Hours]- 184

 

Some of the contractors have two PO Lines so I created a new table to sum the hours as follows:

'POLineTotal'[TotalPOHours]

 

How can I point to the new table to use 'POLineTotal'[TotalPOHours] instead of 'FY19'[POHours] for September?

 

 

 

Greg_Deckler
Community Champion
Community Champion

If you want this as a column, then:

 

Total PO Hours = 
SUMX(FILTER(ALL('Table'),[Contractor]=EARLIER([Contractor])),[PO Hours])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Greg,

You did answer my question but I need to sum the PO Hours in PO Line 1 and PO line 2 together for the contractors who have two line items (each on a separate row/record). I tried filtering the PO Lines but it did not sum them. The new table suggested by someone else works great but now my data is in a another table and I need to create a relationship to use it. I am working on that  now. Any suggestions on creating a relationship appreciated.

Anonymous
Not applicable

I figured it out - just fyi. When I created the new table as instructed to SUM both PO Lines and eliminate the PO Line 2 rows to prevent it from showing two visuals for one person, it did not have the director column. I added the director column from the original data file using by adding it the following formula that was used to create the new POLineTotal table and it worked. Thank you everyone -Yuliana, Frank, and Greg - for your help. Takes a village.

POLineTotal = SUMMARIZE(FY19RemainingHoursReport,FY19RemainingHoursReport[Director],FY19RemainingHoursReport[Contractor, PO, End Date],"Total PO Hours",SUM(FY19RemainingHoursReport[ PO Hours]))

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.