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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Sam-L
Frequent Visitor

Date in the past or future

Hello,

I'm looking to create a new column in a table that states 'valid' or 'invalid' based on if a date field is in the past (invalid) or future (valid).

I'm struggling with how to do this. My column is in short date format (dd/mm/yyyy). My date field is in a table named Courses and the field name is employee_training_courses.expires_on.

I've tried myself to workout a DAX query or a new column but can't work it out.

Thanks in advance for your tips.

Sam

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Sam-L ,

a new column

Switch( True(),

[Date] < today(), "Invalid",

[Date] > today(), "Valid",

"Today"

)

 

Change as per need

View solution in original post

2 REPLIES 2
GregVia
Frequent Visitor

Try this:

Valid = IF(
Data[Date]>=TODAY(),
"Valid",
 
Use your date column at the place of Data[Date]
"Non Valid")
 
Let me know
 
GV
amitchandak
Super User
Super User

@Sam-L ,

a new column

Switch( True(),

[Date] < today(), "Invalid",

[Date] > today(), "Valid",

"Today"

)

 

Change as per need

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.