Forum Discussion

Giadev's avatar
Giadev
Frequent Visitor
7 years ago
Solved

Subototal from average to sum

 

I need a function to calculate the sum instead of the average.

 

The average size I used is:

CostRentalPerPage = CALCULATE(AVERAGE(PrintAudit[Cost Rental Day])/[PagesDays])
CostRental = CALCULATE(SUM(PrintAudit[PagesTotal])*[CostRentalPerPage])


Thanks!

 

2 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Giadev ,

    You may refer to using SUMX to calculated the total value:

     

    Regards,

    Daniel He

    • Giadev's avatar
      Giadev
      Frequent Visitor

      Thanks for the tip, I used sumx in this way:

       

      CostRental =
      IF(HASONEVALUE(PrintAudit[Printer]);CALCULATE(SUM(PrintAudit[PagesTotal])*[CostRentalPerPage]);
      SUMX(VALUES(PrintAudit[Printer]);CALCULATE(SUM(PrintAudit[PagesTotal])*[CostRentalPerPage])))