Forum Discussion
Filter function not working with MAX function
Hi All,
I want to calculate the latest outstanding value corresponding to some columns (eg: Age_profile , Status) provided that the data is for whole of previous week and the file type is OS.
I'm using below measure to calculate the outstanding volume
CALCULATE (
SUM ( LatestWeek[Volume] ),
FILTER (
LatestWeek,
LatestWeek[WEEK_Commencing_Date] = MAX ( LatestWeek[WEEK_Commencing_Date] )
),
FILTER ( LatestWeek, LatestWeek[File_Type] = "OS" )
)
CALCULATE (
SUM ( LatestWeek[Volume] ),
FILTER (
LatestWeek[LatestWeekCheck]=1
),
FILTER ( LatestWeek, LatestWeek[File_Type] = "OS" )
)
- Anonymous6 years ago
Hi Anonymous ,
Measure works on visual level. In the first measure, you used filter(table), so the max() function wouldn't give you the max value for all table but only the max value for the row. You can create a single measure like maxvalue = max(table[column]) to check.
In that case you may use ALLSELECTED() or ALL() function like below.
In addition, It's better to share some sample data to us so that we can deal with the DAX for you.
Best Regards,
Jay
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
Measure works on visual level. In the first measure, you used filter(table), so the max() function wouldn't give you the max value for all table but only the max value for the row. You can create a single measure like maxvalue = max(table[column]) to check.
In that case you may use ALLSELECTED() or ALL() function like below.
In addition, It's better to share some sample data to us so that we can deal with the DAX for you.
Best Regards,
Jay