Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Max date and max value is not working properly

Hello everyone I want to get the max value of Succedd_Row_Count based on the Max_Date, but 

Max date = MAX(AUDIT_LOG[AUDIT_TS]) is giving multiple max for DIM_PRC_CTLG_HIST on 2/12/2024 and I just want the max per day for each audit name.
 
This is also happening for the rest of the columns, I want the max value of Succedd_Row_Count  for each one of the seven last days 
in this case I´m using 
Current Day-7 = CALCULATE(MAX(AUDIT_LOG[SUCCEED_ROW_COUNT]), DATESINPERIOD(AUDIT_LOG[AUDIT_TS].[Date], MAX(AUDIT_LOG[AUDIT_TS]),-7,DAY)) and also tried CALCULATE(max(Table[Value.high]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,Day)). 
Current Day -7 = CALCULATE(COUNT(AUDIT_LOG[SUCCEED_ROW_COUNT]),DATEADD(AUDIT_LOG[AUDIT_TS].[Date], -7,DAY))
All with the same result

Any ideas on how can I fix this formulas to get the desire results?

All the help is highly appreciated 

 

Thanks!

1 Reply