The below is a measure, which i am expecting to returning 1 to max -1 or max when the value of company order date is max. I am not getting the correct value of the first vMaxIndex , it shiuld be 12, but it is coming as 19. ANy clues of whats wrong? I am using the return values to test, later teh return variable values will need to be replaces by calcluate expressions. Thanks
Previous Period Manage Seats = var vMaxIndex = CALCULATE(MAX('Company Detail'[Company Date Order] ),FILTER(All('Company Detail'),MAXX(Filter('Company Detail', Earlier('Company Detail'[Company_RecID])='Company Detail'[Company_RecID]),'Company Detail'[Company Date Order] ) ))
var vCurrenttIndex=CALCULATE(MAX('Company Detail'[Company Date Order] ),FILTER(All('Company Detail'),MAXX(Filter('Company Detail', Earlier('Company Detail'[Company_RecID])='Company Detail'[Company_RecID] && Earlier('Company Detail'[Date_Inserted])='Company Detail'[Prior Month]),'Company Detail'[Company Date Order] )))
var vFirstMgmSeats= 0
return
IF( AND(vCurrenttIndex=vMaxIndex,vCurrenttIndex=vMaxIndex) ,
CONCATENATE( vMaxIndex,CONCATENATE(" , " , vCurrenttIndex))
,
CONCATENATE( vMaxIndex,CONCATENATE(" , " , vCurrenttIndex)) )
