Forum Discussion

darko861's avatar
darko861
Icon for Resolver II rankResolver II
5 years ago
Solved

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())

 

 

Thanks in advance!

  • 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())

2 Replies

  • 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())

    • darko861's avatar
      darko861
      Icon for Resolver II rankResolver II

      thank you amitchandak, it worked beautifully.

       

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