Forum Discussion
Anonymous
7 years agoNot applicable
Column to Find days between dates
Hello, I am looking at traffic on a webpage and for a each page, i have a different publish date. I would like to see the number of days since the publish date for each pageview in a new column. ...
- 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.
jdbuchanan71
7 years agoSuper User
Hello Anonymous ,
Can you give us a screen shot of the table layout? If you have two columns of dates in a single table [Publish Date] and [Traffic Date] you can just do [Traffic Date] - [Publish Date] in a new column to get the number of days.
Anonymous
7 years agoNot applicable
Yes that would work, but i suppose what i am trying to do is match a view date to a publish date. in pseudo code;
If the "Date" is >= June 7 && < June 21, then the"publish date"is June 7th else, publish date is June 21