Forum Discussion

JC2022's avatar
JC2022
Icon for Helper III rankHelper III
3 years ago

How to stop a line

Hi,

I have created 2 measures for the cumulative sales. 1 for Previous fiscal year and 1 for Current Fiscal year for the completed months. At the moment March is still not completed that's why this is not in scope of the line for Current fiscal year. I would like to end this line after the last completed month, but I do not know how. Can you help me? See my formula below!
My result now is shown here:

 

My desired result should be:

 

Formula Current Fiscal Year:

Current Fiscal Year Cumulative Sales for completed months =
CALCULATE(
    SUM(Append3[EUR Sales]),
    FILTER(
        ALLSELECTED('Calendar Posting Date'),
        'Calendar Posting Date'[CurFiscalYearOffset] = 0 &&
        'Calendar Posting Date'[FiscalMonthNum] <= MAX('Calendar Posting Date'[FiscalMonthNum]) &&
        'Calendar Posting Date'[CurrentDayOffset] < 0 &&
        'Calendar Posting Date'[CurMonthOffset] <= -1
    )
)

 

5 Replies

  • hi JC2022 

    try to plot a measure like this instead:

    Measure =
    IF(
        MAX('Calendar Posting Date'[Date]<=MAX(Append3[Date]),
        [Current Fiscal Year Cumulative Sales for completed months]
    )

     

  • Hi FreemanZ 
    This formula gives the following error: Too few arguments were passed to the IF function. The minimum argument count for the function is 2.

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

      Sorry, try like:

      Measure =
      IF(
      MAX('Calendar Posting Date'[Date])<=MAX(Append3[Date]),
      [Current Fiscal Year Cumulative Sales for completed months]
      )

       

      forgot to close the bracket. 

      • JC2022's avatar
        JC2022
        Icon for Helper III rankHelper III

        FreemanZ 
        This is the result of this formula. Not what I was expecting.