locked
IF statement to check for matching text then calculate Date RRS feed

  • Question

  • Hi All,

     I am trying to create measure to check the column[FREQUNIT] with Unit of Dates in TEXT ("Days", "Weeks", "Months" and "Years'). If it "Week"s then my calculated measure of dates will be added with 7 days, 30 Days for Months and so on. I can't get it to work when I am directly referring to the [FREQUNIT] column with IF Statement and  is returning error.

     So I created a measure: "WEEKS:=CONTAINS(PM_LIST_AND_SCHEDULE,[FREQUNIT],"WEEKS") " to check if "the current row is week or month etc.

    When it returns "true" I then use a nested if statement to do the calculations, using this measure:

    "LAST PMDATE:=CALCULATE([COMP DATE],FILTER(page36,[WO ASSOCIATED PMNUMBER]="NEW PMNUMBER"),FILTER(page36,[COMP SCHED PMNUMBER]))"

    This is the Final Measure that is givign the end result: it is working but very slow. Kindly assist a better way.

    NEXT PM DATE:=CALCULATE(IF([WEEKS]=TRUE(),[LAST PMDATE]+7,IF([MONTH]=TRUE,[LAST PMDATE]+30,IF([YR]=TRUE,[LAST PMDATE]+365,IF([DAY]=TRUE(),[LAST PMDATE]+1)))))

     Thank you.



    • Edited by reggiene Wednesday, June 26, 2019 2:46 PM TYPO ERROR
    Wednesday, June 26, 2019 2:45 PM