Forum Discussion
Simple calculated Date field using IF is not working...
- 7 years ago
Hi VFXPro
If you are using the Power Query Editor, then you can add a custom column using this formula. For something like this it doesn't really matter if you create it in M (Power Query) or DAX (Power BI Desktop)
if [Format] = "Digital" then Date.AddDays([ReceivedDate],7) else Date.AddDays([EndDate],7)
Thanks Phil!! Your file works fine. It look like you are creating this new calculated column directly from the table editor, where I was using the Query editor (via Edit Query). When I do use the query editor, with your formula (or mine) I get the followin error...
Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.
Is there a guidelines that tells the user when to create a new column in the data tab vs the use the "Edit Query" that opens a separate editor?
Hi VFXPro
If you are using the Power Query Editor, then you can add a custom column using this formula. For something like this it doesn't really matter if you create it in M (Power Query) or DAX (Power BI Desktop)
if [Format] = "Digital" then Date.AddDays([ReceivedDate],7) else Date.AddDays([EndDate],7)
- VFXPro7 years agoAdvocate II
Thanks Phil_Seamark
This is very valuable guidance... Thank you very much for your kindness and sharing your knowledge.