Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
Im trying to create a custom column which looks to see if an existing column is less the todays date + 60 days and will return text in new column saying "over" or "under"
I wrote the following and I get an error: Need your help please -->
if [Valid until] < DateTime.LocalNow() then "under" else "over"
Solved! Go to Solution.
Actually was able to solve it my self. Using the following:
if [Valid until] < Date.AddDays(Date.From(DateTime.LocalNow()),60) then "under" else "over"
Interesting that you are saying that you solved yourself ... good for you~
Actually was able to solve it my self. Using the following:
if [Valid until] < Date.AddDays(Date.From(DateTime.LocalNow()),60) then "under" else "over"
Date.AddDays(Date.From(DateTime.LocalNow()), 60)
The syntax is for M query
How do I write the same equation but with todays date + 60 days. I just tried this but get an error
if [Valid until] < Date.From(DateTime.LocalNow()) +60 then "under" else "over"
(Note Valid until is a date)
Assuming "Valid until" is a date data type field, try this ...
Date.From(DateTime.LocalNow())
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |