Forum Discussion
Krisso1975
5 years agoRegular Visitor
Merge not pulling through correct information
I have couple of tables in power query, 1 for periods in the year and one showing billing data. I have created a column in the periods in the year that seems to be working that if today is greater th...
- 5 years ago
Hi, Krisso1975
Based on your description, I assume that you want to create a custom column based on date column. I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a custom column with the following m codes.
let start = Date.AddDays( Date.EndOfMonth( Date.AddMonths([Date],-1)),1), end = Date.EndOfMonth([Date]), today = Date.From(DateTime.LocalNow()) in if today<start then "Next" else if today>end then "Previous" else if today>=start and today<=end then "Current" else nullResult:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HotChilli
5 years agoCommunity Champion
I'm out for the rest of the day, so sorry won't be able to reply.
Krisso1975
5 years agoRegular Visitor
I possibly fixed it by not using a calculated coumn but a version of, if and, in a normal column.
Thank you for your help