Forum Discussion

ckolahi's avatar
ckolahi
Frequent Visitor
4 years ago
Solved

Divide rows (calculated column) with different parameters

Hi Guys

 

I have the table below. The idea is to create a calculated column (in blue) to represent Actuals (A) vs Budget (B), for each month, quarter, product, reps etc..

 

Any ideas

Thanks

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi ckolahi

     

    Please try this code

    Desired =
    var maxamt=calculate(max(Feuil2[Value_SIP]),ALLEXCEPT(Feuil2,Feuil2[Names],Feuil2[Measure SIP],Feuil2[Month],Feuil2[Year]))
    return
    divide(Feuil2[Value_SIP],maxamt,0)

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ckolahi

     

    Please try this code

    Desired =
    var maxamt=calculate(max(Feuil2[Value_SIP]),ALLEXCEPT(Feuil2,Feuil2[Names],Feuil2[Measure SIP],Feuil2[Month],Feuil2[Year]))
    return
    divide(Feuil2[Value_SIP],maxamt,0)
  • ckolahi's avatar
    ckolahi
    Frequent Visitor

    Anonymous 

     

    super thanks it works. However I think y example was misleading. What would be if the B value was not the Max value ? 

     I tried to create variable actuals (A) vs (B) with FILTER function, was not successful.

    If any ideas please feel free.

    Thanks