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.
I want to create a conditional or a custom column within Power Query (using M) and NOT DAX, Here is my requirement
if [Consent Application Submitted] is not blank and [Consent Application Submitted] > 6 Weeks from today then "White"
if [Consent Application Submitted] is not blank and [Consent Application Submitted] < 6 Weeks from today then "Red"
I know I can do this using DAX (DATEDIFF). However, I want to create a column using Power Query.
Is there a way to achieve this in Power Query or the M code.
Solved! Go to Solution.
Hi @smjzahid ,
You could refer to the following codes:
if
Duration.Days(Date.From(DateTime.LocalNow())-[Date])>42
then "White"
else "Red"
Hi @smjzahid ,
You could refer to the following codes:
if
Duration.Days(Date.From(DateTime.LocalNow())-[Date])>42
then "White"
else "Red"
Hi @smjzahid ,
Try this one:
if [Date] > Date.AddWeeks(Date.From(DateTime.LocalNow()), 6) then
"White"
else
"Red"
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
7 | |
6 | |
6 |