Forum Discussion

kevin121519's avatar
kevin121519
Frequent Visitor
9 years ago
Solved

YTD Measure using Forecast for uncompleted month

This has been an interesting and challenging measure to create. I am looking to create a measure that calculates the YTD sales up to the last completed month. For any month that has yet to be complet...
  • dearwatson's avatar
    dearwatson
    9 years ago

    OK I built something that looks to work... proabably could be optimised:

     

    Base Measures:

    Current Month = MONTH(TODAY())

    Current Year = YEAR(TODAY())

    FP Month = MONTH(MAX(Table1[Fiscal Period]))

    FP Year = YEAR(MAX(Table1[Fiscal Period]))

    Total Estimate = SUM(Table1[Estimate])

    Total Sales = SUM(Table1[Sales])

     

    Outputs

    Output = IF([FP Month]<[Current Month]||[FP Year]<[Current Year],[Total Sales],[Total Estimate])

    I needed to SUMX these for the YTD to work properly - note the incorrect Total of Output 1 in the pic

    Output2 = SUMX(Table1,[Output])

     

    FPYTD = CALCULATE([Output2],DATESYTD(Table1[Fiscal Period],"11/30"))