Forum Discussion
Column to Find days between dates
- 7 years ago
That is the PowerQuery editor which uses an entirely different language, called M. Your formula will look something like this.
= if [Date] >= Date.FromText("6/7/2019") and [Date] < Date.FromText("6/21/2019") then Date.FromText("6/7/2019") else Date.FromText("6/21/2019")I would load it to PowerBI and do it in DAX rather than adding the column in the query editor.
Two things, from a dax perspective you are missing a comma. The DAX below is fixed. Also, is [Date] a column or measure? Do you want your output to be a calculated column or measure? This should help direct a better answer should the missing comma not be the problem.
Test =
IF(
[Date] >=DATE(2019,6,7) &&
( [Date]<DATE(2019,6,21)),
DATE(2019,6,7),
DATE(2019,6,21))Hi MitchM,
I am looking to produce a calculated column.
I tried your code but i recivere a "Token Literal Expected" Error
- jdbuchanan717 years agoSuper User
That is the PowerQuery editor which uses an entirely different language, called M. Your formula will look something like this.
= if [Date] >= Date.FromText("6/7/2019") and [Date] < Date.FromText("6/21/2019") then Date.FromText("6/7/2019") else Date.FromText("6/21/2019")I would load it to PowerBI and do it in DAX rather than adding the column in the query editor.