Forum Discussion
Add future month Date to Current Date
In my data source i have a column "Count" and i am generating "Date" Column by using "DateTime.LocalNow()".
now i want to create one more table with same "Count" Column , but "Date" as 01/07/2020.
Ex:
And then i would like to append second table to first table. The reason am doing like this is, now i have "Count" only for Current date but i need same count for next month as well. (Note : if not for 01/07/2020 any other date,something like current date + 30 days also works, 'Day' doestn't matter).
Any help on this please? Thanks in Advance.
Hi yodha ,
Firstly, you may enter into Query Editor, select on your query, go to Add column ->Custom column, type codes as below to create two columns [Current Date] and [Future Date] .
DateTime.LocalNow()
Date.AddDays([Current Date], 30)
Secondly, you may select on the two date columns at the same time, right click to choose option "Unpivot Columns", rename the new result column Value with "Date".
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandak
Super User
yodha , Not very clear what are you doing
You can use append in power query
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
And Union in Dax
union(Table1,Table2)
Or other examples
Order Dim = (UNION(ALL('order'[Order No]),ALL(delivery[Order No])))
Order Deatils Dim = (UNION(SELECTCOLUMNS('order',"Order",'order'[Order No]),ALL(delivery[Order No])))https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
- v-xicai
Community Support
Hi yodha ,
Firstly, you may enter into Query Editor, select on your query, go to Add column ->Custom column, type codes as below to create two columns [Current Date] and [Future Date] .
DateTime.LocalNow()
Date.AddDays([Current Date], 30)
Secondly, you may select on the two date columns at the same time, right click to choose option "Unpivot Columns", rename the new result column Value with "Date".
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.