Forum Discussion

deb_power123's avatar
deb_power123
Icon for Helper V rankHelper V
5 years ago
Solved

DAX to remove the null values from the maximum and minimum selected date slicer?

Hi All,

 

I have the below Student table with columns as below :-

StudentID
StudentName
LastAttendanceDate
StudentType

 

I have some null values for the Last attendance Date .I have a table visualization for the student table and have a date slicer with Last Attendance Date filter.

I want to remove all the null values for the selected minimum and maximum date range in my date slicer .

My input data :

StudentIDStudentNameLastAttendanceDateStudentType
100Harry10-05-2011 10:45Fulltime
100Harry Fulltime
101Mary02-05-2011 12:45Fulltime
101Mary02-05-2011 15:45Fulltime
101Mary Fulltime
101Mary02-05-2011 19:45Fulltime
102James02-05-2011 12:45Part Time
102James02-05-2011 18:45Part Time
103John12-05-2011 12:45Part Time
103John12-05-2011 14:45Part Time
103John Part Time
103John12-05-2011 16:45Part Time
103John14-05-2011 16:45Part Time

 

My visualization slicer:

Expected Output:

The ones which are ticked these rows should be removed based on my selection range of date slicer:

 

Please suggest a dax measure to handle this.

 

I tried a measure below it didnt work:-

 

filter_measure =

var x1= calculate Max(student[LastAttendanceDate],ALLSELECTED(student[LastAttendanceDate])

var x2= calculate Min(student[LastAttendanceDate],ALLSELECTED(student[LastAttendanceDate])

return

IF(NOT(ISBLANK(Max(student[LastAttendanceDate])= null,1,0)

IF(NOT(ISBLANK(Min(student[LastAttendanceDate])= null,T,F)

 

I need to exclude all those null values for Last Attendance date when i select any given range in my date slicer.

student may come on the next day to school but for the datetime which is null I should get rid of that row

Kind regards

sameer

  • deb_power123 , Add a visual level filter LastAttendanceDate is not blank

     

    or in your measure like

     

    calculate(Min(student[LastAttendanceDate]),filter(student,not(isblank(student[LastAttendanceDate]))))

2 Replies

  • deb_power123 , Add a visual level filter LastAttendanceDate is not blank

     

    or in your measure like

     

    calculate(Min(student[LastAttendanceDate]),filter(student,not(isblank(student[LastAttendanceDate]))))