Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculated groups DAX error

Hello - can anyone tell me why this DAX is not working when i use to try and create a calculation group...? Thanks in advance!   VAR date = MAX ( BO_data[Reference_Date] ) VAR LastDec = DATE ( Y...
  • amitchandak's avatar
    4 years ago

    Anonymous , try like

     

    VAR _date =
    MAXX (allselcted( BO_data), BO_data[Reference_Date] )
    VAR LastDec = DATE ( YEAR ( ( _date ) - 1 ), 12 , DAY ( _date ) )
    VAR RESULT =
    CALCULATE (
    SELECTEDMEASURE (),
    FILTER (all( 'Calendar'), 'Calendar'[Date] <= LastDec )
    )
    RETURN
    RESULT

     

    if needed remove all from calendar