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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Rngomoa
Frequent Visitor

select if date is greater than the selected slicer date

Hello,

 

Am trying to define a measure where any date (date_lab_ordered) greater than -12 months of the selected slicer date (CalenderDate[dates]) if a valid date.

 

my DAX is as follows.

 

Valid=IF(date_lab_ordered>MAXX(DATEADD(CalenderDate[dates],-12,MONTH),CalenderDate[dates]),"Valid","Not Valid")

 

However, this labels all cases in the data as valid. Any help is much appreaciated. Thanks

 

1 REPLY 1
FreemanZ
Super User
Super User

hi @Rngomoa 

how are you going to use this measure, or what context do you have?

 

if you are plotting the table as it is in the dataset, try to plot with a measure like:

Valid=
IF(  MAX(TableName[date_lab_ordered])>EDATE(SELECTEDVALUE(TableName[date_lab_ordered]), -12),
"Valid","Not Valid"
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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