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
darko861
Resolver II
Resolver II

Summarize two columns from another table based on conditions

Hi community,

 

I have created a new table based on columns from a different table. Everything works fine except the last column "Total Hours 2" which does not summarize correctly, it gives the same result for each row. The "Total hours 2" syntax has to be tweaked. All other columns are correct. Do you have any suggestions on how to tweak the code?

"Total Hours 2", sum(v_rpt_Service[Hours_Billable]) + SUM(v_rpt_Service[Hours_NonBillable])

 

I guess this condition has to be incorporated somehow in the above code?

"TicketsResolved", CALCULATE(COUNT(v_rpt_Service[TicketNbr]),v_rpt_Service[Date_Resolved_UTC]<>BLANK())

 

darko861_0-1619685391255.png

 

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

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

 

Try like

Total Hours 2 =  calculate( sum(v_rpt_Service[Hours_Billable]) + SUM(v_rpt_Service[Hours_NonBillable]), v_rpt_Service[Date_Resolved_UTC]<>BLANK())

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

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

 

Try like

Total Hours 2 =  calculate( sum(v_rpt_Service[Hours_Billable]) + SUM(v_rpt_Service[Hours_NonBillable]), v_rpt_Service[Date_Resolved_UTC]<>BLANK())

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 @amitchandak, it worked beautifully.

 

Why can't you use Filter function in the syntax in this case? 

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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