Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Good Morning Power Bi Users!
I would like to create a visual for my metric showing all items that are due within next 7 days.
As per below it looks like you cannot add an expression into the value.
Any ideas?
Thanks,
Solved! Go to Solution.
Hi @Anonymous ,
The first issue is that TODAY() is a DAX function but Power Query uses the M language.
In Power Query, go to the Add Column tab > Custom Column and paste in this code:
let __todayDate = Date.From(DateTime.LocalNow()) in
if [Due Date] >= __todayDate and [Due Date] <= Date.AddDays(__todayDate, 7) then "Due within 7 days"
else "Not due within 7 days"
Pete
Proud to be a Datanaut!
Hi @Anonymous ,
The first issue is that TODAY() is a DAX function but Power Query uses the M language.
In Power Query, go to the Add Column tab > Custom Column and paste in this code:
let __todayDate = Date.From(DateTime.LocalNow()) in
if [Due Date] >= __todayDate and [Due Date] <= Date.AddDays(__todayDate, 7) then "Due within 7 days"
else "Not due within 7 days"
Pete
Proud to be a Datanaut!
Hi Pete,
As suggested copied and pasted the formula and now getting the below error:
Thanks for the help.
I missed a space in the second [Due Date].
I've updated my original answer to correct. Please try now.
Pete
Proud to be a Datanaut!
You legend! Thats worked. Thank you very much for the help!
Check out the July 2025 Power BI update to learn about new features.