Forum Discussion

jpfeif1's avatar
jpfeif1
New Member
3 years ago
Solved

Question on how to sumif when creating a variable

  I have the following Dax formula.  Y2023 = rounddown(CALCULATE(sum(EROSION[Value]), EROSION[DATA TYPE] in {"FUNNEL","Baseline","Forecast"},EROSION[Year]="Y2023")/1000000,1)   I would the abili...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi jpfeif1 

    You can try the following code:

     

    Y2023 = switch(true(),EROSION[DATA TYPE] in {"FUNNEL","Forecast"},rounddown(CALCULATE(sum(EROSION[Value]),EROSION[Year]="Y2023")/1000000,1),EROSION[DATA TYPE] in {"Baseline"},rounddown(CALCULATE(sum(EROSION[Value]),EROSION[Year]="Y2023")/2000000,1))
    
    

     

    Best Regards!

    Yolo Zhu

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