Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Help With IF and SUM

Hi,

 

I am trying to recreate the following calculation into a DAX Measure. Please can someone advice how ths is possible:-

 

    if  {Job_Mth}<={Current Month (Year Month YYYY-MMM Selection from Slicer} then

         SUM{Job Projected Pounds}

    else

        SUM{Job Contract Amount}

 

Thanks in advance

2 Replies

  • moizsherwani's avatar
    moizsherwani
    Icon for Continued Contributor rankContinued Contributor

    Anonymous it is not at all clear what your data model looks like so it is not possible to give an answer. Please share a picture of the model and the fields.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could try to use DATEVALUE function converts a date in "YYYY-MMM" format to a date in datetime format. Your formula can be recreated into a measure.

     

     

    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.