Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

TotalCost based on Table or Matrix Value

I have pivot table in excel and I have calculated total cost based on the values of my calculations in the pivot table and I would do samething in excel but I am not sure how, Please below my sample data and formula used.

Course Duration*(Attendees feeding cost+Location Fees+Facility Fee)

 

NameCourse DurationNumber of AttendeesAttendees feeding costLocation FeesFacility FeeTotal Cost
CAS2.594515050612.5
 11515050205
FF121015050210
hs 1   0
POS2.56   0

 

Totalcost = =C5*(E5+F5+G5)

Ashish_Mathur Greg_Deckler 

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    for me to be able to try the formula you supplied, i need to derive number of attendee: i used counifs please sample below 

    =COUNTIFS(B:B,B2,C:C,C2,A:A,A2),please help with Dax for the countifs

    DateNameStatusOutput
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    11/06/2019 07:00CASEnrolled9
    10/06/2019 08:30PATEnrolled6
    10/06/2019 08:30PATEnrolled6
     PATEnrolled0
    19/05/2019 23:00PATEnrolled1
    10/06/2019 08:30PATEnrolled6
    10/06/2019 08:30PATEnrolled6
    10/06/2019 08:30PATEnrolled6
    10/06/2019 08:30PATCancelled1
    10/06/2019 08:30PATEnrolled6
    10/07/2019 23:00CASEnrolled1
    10/07/2019 23:00CAS - CLONED(25/07/2019)Enrolled2
    10/07/2019 23:00CAS - CLONED(25/07/2019)Enrolled2

     

    amitchandak 

     

13 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      for me to be able to try the formula you supplied, i need to derive number of attendee: i used counifs please sample below 

      =COUNTIFS(B:B,B2,C:C,C2,A:A,A2),please help with Dax for the countifs

      DateNameStatusOutput
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      11/06/2019 07:00CASEnrolled9
      10/06/2019 08:30PATEnrolled6
      10/06/2019 08:30PATEnrolled6
       PATEnrolled0
      19/05/2019 23:00PATEnrolled1
      10/06/2019 08:30PATEnrolled6
      10/06/2019 08:30PATEnrolled6
      10/06/2019 08:30PATEnrolled6
      10/06/2019 08:30PATCancelled1
      10/06/2019 08:30PATEnrolled6
      10/07/2019 23:00CASEnrolled1
      10/07/2019 23:00CAS - CLONED(25/07/2019)Enrolled2
      10/07/2019 23:00CAS - CLONED(25/07/2019)Enrolled2

       

      amitchandak 

       

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous 

         

        Try as a new column

         

        Output = countx(filter(Table,Table[Name] =earlier(Table[Name]) && Table[Status] =earlier(Table[Status])),Table[Date])

         

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      sumx(Table,Table[Course Duration]*(Table[Attendees feeding cost]+Table[Location Fees]+Table[Facility Fee])) is not returning the expected result, I think my explanation wasnt clear enough earlier 

       

      Derived columns : 

      FaVeFee = [Duration]*([Locationfee]+[FacilityFee])
      FeedingCost = [Duration]*[Output]*[Feeding]
      Total = [FaVeFee]+[FeedingCost]

       

      I would like to archive below total with without having to create different colums in other to archive my result. I have attached a screenshot of the visulisation sample that I would like to archieve 

       

      FacilityFeeFeedingDateLocationfeeDurationNameStatusOutputFaVeFeeFeedingCostTotal
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
      50511/06/2019 07:001502.5CASEnrolled9500112.5612.5
        10/06/2019 08:30 2.5PATEnrolled6   
        10/06/2019 08:30 2.5PATEnrolled6   
           PATEnrolled0   
        19/05/2019 23:00  PATEnrolled1   
        10/06/2019 08:30 2.5PATEnrolled6   
        10/06/2019 08:30 2.5PATEnrolled6   
        10/06/2019 08:30 2.5PATEnrolled6   
        10/06/2019 08:30 2.5PATCancelled1   
        10/06/2019 08:30 2.5PATEnrolled6   
      50510/07/2019 23:001501CASEnrolled220010210
      50510/07/2019 23:001501CAEnrolled12005205
      50510/07/2019 23:001501CASEnrolled220010210

       

      Final Output: 

      amitchandak 

      Thanks