Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

calculation based on multiple conditions and parameter value

Hi there,   i was wondering if its possible to calculate (either via measure or calculated column) a value based on multiple conditions AND including a parameter value.   Scenario:   for each c...
  • v-jingzhang's avatar
    3 years ago

    Hi Anonymous

     

    For each company's charge, you can use the following measure.

    Charge = 
    SWITCH(SELECTEDVALUE(Companies[Company type]),
    "Banking",[Parameter_Fee_Banking Value]*SUM(Companies[Users])+MAX(SUM(Companies[Access points])-4,0)*500+MAX(SUM(Companies[Speed])-15,0)*250,
    "Construction",[Parameter_Fee_Construction Value]*SUM(Companies[Users])+MAX(SUM(Companies[Access points])-5,0)*500+MAX(SUM(Companies[Speed])-10,0)*250,
    "Health care",[Parameter_Fee_HealtCare Value]*SUM(Companies[Users])+MAX(SUM(Companies[Access points])-3,0)*500+MAX(SUM(Companies[Speed])-5,0)*250
    )

    However above measure doesn't calculate the total charge of multiple companies correctly if you want to show the totals. So you need to use the following measure which calculates the sum of above measure. 

    Total Charge = SUMX(VALUES(Companies[Company name]),[Charge])

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.