Forum Discussion

dmarkie's avatar
dmarkie
Frequent Visitor
4 years ago
Solved

MAXX Syntax and Locatin

Hi.  Newer to DAX and still learning.  I've read much and vids on Maxx but am having difficulty in achieving the desired outcome in this table creation.   I have two tables linked on the MasterID fie...
  • AilleryO's avatar
    AilleryO
    4 years ago

    No problem, sorry for not being more specific and anyway I was wrong, you should add the filter when you calulate max per MasterID, like :

    Table = 
    VAR CurrentMasterID = MAX( [MasterID] )
    VAR TempTable = FILTER (RELATEDTABLE(Detail), NOT ISBLANK('Detail'[VEHICLE ID]) && Detail[MasterID]>250 && CONTAINSSTRING(Detail[Description]"lof") )
    RETURN
    ADDCOLUMNSTempTable , "Last Date" , CALCULATE(MAXX'Detail'[Date]) , MasterID = CurrentMasterID  )
     
    Let us know if it works