Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hello,
I am trying to using the dates in the left column and add the months listed in the right column to create a new column. Can someone explain what I’m doing wrong?
Thank you!
Solved! Go to Solution.
Hi @Km93
The issue seems to be a missing else clause.
In M, the syntax of an if expression must be
if <if-condition> then <true-expression> else <false-expression>
For example, if you want to return null when the condition is false, you could write:
if [Contact Frequency] = 1 then Date.AddMonths([Last Contact Attempt],1) else null
See here for more examples/discussion:
hi @Km93 ,
Use this corrected formula to handle the text and numeric parts in Contact Frequency:
if Text.Contains([Contact Frequency], "mo") then
Date.AddMonths([Last Contact Attempt], Number.FromText(Text.BeforeDelimiter([Contact Frequency], " ")))
else
null
It extracts the numeric value before "mo" and applies Date.AddMonths accordingly.
Hi @Km93, Hope your issue is solved. If it is, please consider marking the answer 'Accept as solution', so others with similar issues may find it easily. If it isn't, please share the details.
Thank you.
Hi @Km93, Hope your issue is solved. If it is, please consider marking the answer 'Accept as solution', so others with similar issues may find it easily. If it isn't, please share the details.
Thank you.
Hi @Km93 , Hope your issue is solved. If it is, please consider marking the answer 'Accept as solution', so others with similar issues may find it easily. If it isn't, please share the details. Thank you.
hi @Km93 ,
Use this corrected formula to handle the text and numeric parts in Contact Frequency:
if Text.Contains([Contact Frequency], "mo") then
Date.AddMonths([Last Contact Attempt], Number.FromText(Text.BeforeDelimiter([Contact Frequency], " ")))
else
null
It extracts the numeric value before "mo" and applies Date.AddMonths accordingly.
Hi @Km93
The issue seems to be a missing else clause.
In M, the syntax of an if expression must be
if <if-condition> then <true-expression> else <false-expression>
For example, if you want to return null when the condition is false, you could write:
if [Contact Frequency] = 1 then Date.AddMonths([Last Contact Attempt],1) else null
See here for more examples/discussion:
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 13 | |
| 11 | |
| 11 | |
| 7 | |
| 6 |