Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

How to change the base function in Dax

my calculations are as below. 
Base = Sum( mydf[amount])
Function1 = Calculate([Base],....)
Function2 = Calculate([Base],....)
Function3 = Calculate([Base],....)
Total = Function1 + Function2 + Function3
###################
I would like change my Base functions as follows
Base_1 = SUMX(  mydf, mydf[amount]*1 )
Base_2 = SUMX(  mydf, mydf[amount]*2 ) 
and save them as Total_1 and Total_2
###################
If I wanna change the base function only once, I would just change it and the Total would be Total_1.
But how can i store it, if i wanna change twice efficiently ?

many thanks in advance.


5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I have a final dax function as Total. I would like to copy and save all the codes are needed to calculate to Total function.
    Base = Sum( mydf[amount])

    Function1 = Calculate([Base],....)
    Function2 = Calculate([Base],....)
    Function3 = Calculate([Base],....)
    Total = Function1 + Function2 + Function3

    How can i do that in power bi ?

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

      Please describe what you mean by "copy and save".  Power BI has no memory. There is nothing in DAX that would allow you to call external functions.  The DAX paradigm for that is measures.

  • Staging is done in Power Query or further upstream, very rarely in DAX.

  • Anonymous's avatar
    Anonymous
    Not applicable

    it is not what i am asking

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

      I replied in your other post. DAX only has measures. Power Query has functions.