Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
deb_power123
Helper V
Helper V

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:

1.JPG

Expected Output:

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

1.JPG

 

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

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@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]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thankyou Amit :)..you are awesome

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors