Skip to content

Instantly share code, notes, and snippets.

@PBI-DataVizzle
Created April 26, 2022 13:20
Show Gist options
  • Select an option

  • Save PBI-DataVizzle/2267a917ac9038d5965e2ed9eb46ea9c to your computer and use it in GitHub Desktop.

Select an option

Save PBI-DataVizzle/2267a917ac9038d5965e2ed9eb46ea9c to your computer and use it in GitHub Desktop.
Latest MTD calculation
Measure | CFYTD =
// current fiscal year to date of [BaseMeasure]
VAR _ytd =
    CALCULATE ( MAX ( _Dates[LatestMTD] ), REMOVEFILTERS () )
VAR _result =
    CALCULATE (
        [BaseMeasure],
        KEEPFILTERS ( _Dates[Date] <= _ytd ) 
        // , Dates[IsCFY] = TRUE
    )
RETURN
    _result
// IF(  NOT ISBLANK( [BaseMeasure] ) ,  _result  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment