Forum Discussion

jesly_ajin's avatar
jesly_ajin
Icon for Helper III rankHelper III
5 years ago
Solved

Calculation using 2 measures gives in correct total in Table

Hi dears,

I have 2 measures namely - 

1. ECPlanCount is SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1), SelfService_Plan_DailyPlanHour[ECPlannedCount])
 
2. ECPlanCost is SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1), SelfService_Plan_DailyPlanHour[ECPlannedCost])
 
3. I have another measure that uses these measures
DActualCost = [ECPlanCount]*10*[ECPlanCost]
 
When these are put in matrix or table, the sum of ECPlanCount & ECPlanCost, however, the total os DActualCost is incorrect.
Kindly help.
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi jesly_ajin ,

     

    I created a sample pbix with your measure.

     

    You can use new measure like

    DActualCost = SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1),[ECPlanCount]*10*[ECPlanCost])

     

    Or

    AnotherDActualCost = CALCULATE([ECPlanCount]*10*[ECPlanCost],ALL('SelfService_Plan_DailyPlanHour'))

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jesly_ajin ,

     

    I created a sample pbix with your measure.

     

    You can use new measure like

    DActualCost = SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1),[ECPlanCount]*10*[ECPlanCost])

     

    Or

    AnotherDActualCost = CALCULATE([ECPlanCount]*10*[ECPlanCost],ALL('SelfService_Plan_DailyPlanHour'))

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • jesly_ajin , Multiplication should be done at line level, Try like

    DActualCost =

    SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1), SelfService_Plan_DailyPlanHour[ECPlannedCount]*SelfService_Plan_DailyPlanHour[ECPlannedCost])

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        jesly_ajin there was *10 too, try

        SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1), SelfService_Plan_DailyPlanHour[ECPlannedCount]*SelfService_Plan_DailyPlanHour[ECPlannedCost]*10)

         

        or

         

        SUMX(FILTER(SelfService_Plan_DailyPlanHour, SelfService_Plan_DailyPlanHour[RANKPlan]=1), SelfService_Plan_DailyPlanHour[ECPlannedCount]*SelfService_Plan_DailyPlanHour[ECPlannedCost])*10

         

         

        if not

         

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