Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

MTD Value zero for after dates

Hello All,

 

I have MTD measure and below is the output, but i have values still Sep 7th, and need to show 0 after sep 7th. But in the below tabel it is showing total.

Mesure is 

MTD 2 = CALCULATE(
    SUM(sales[QtyHl]),
    DATESMTD(az_dim_date[Date])
)

 

3 Replies

  • try this

    MTD 2 = 
    IF( SUM(sales[QtyHl]),
      CALCULATE(
        SUM(sales[QtyHl]),
        DATESMTD(az_dim_date[Date]),0)
    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried that below is the error.

       

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

        you forgot a parenthesis

         

        MTD 2 =
        IF( SUM(sales[QtyHl]),
        CALCULATE(
        SUM(sales[QtyHl]),
        DATESMTD(az_dim_date[Date])

        ) ,

        0)