Forum Discussion

Connerf's avatar
Connerf
Frequent Visitor
7 years ago
Solved

Month to Go Calculation

Hey Power BI Team,   I'm looking for a bit of help regarding a month to go (MTG (no not magic the gathering)) calculation. The calculation needs to accomplish the following three things:   Retur...
  • AlB's avatar
    AlB
    7 years ago

    Connerf 

    Ok, try this slight change then. Remember to always show an example based on your data to explain what you need. It is very helpful for those trying to provide an answer

    TG Production =
    VAR maxDate =
        IF (
            MONTH ( TODAY () ) = MONTH ( MAX('Date'[Date] )),
            EOMONTH ( TODAY (), 0 ),
            MAX ( 'Date'[Date] )
        )
    RETURN
        CALCULATE (
            [Total Schedule],
            FILTER ( 'Date', 'Date'[Date] >= TODAY () && 'Date'[Date] <= maxDate )
        )