Forum Discussion
Creating a date column
- 3 years ago
Hi, Anonymous
Thanks for your quick response!
When the [Period]=1, the date is the Dec in the last year.Here are the steps you can refer to :
We can click "Custom Column" and enter this:
if [Period]=1 then #date([FY]+2000-1,12,1) else #date([FY]+2000,[Period]-1,1)Then we can modify the data type we want :
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Aniya, thanks for your support so far!!
I have replicated what I want to obtain in Excel:
I have calculate the rightmost table using the following excel formula:
=DATE(IF([@Period]=1;[@FY]+2000-1;[@FY]+2000);IF([@Period]=1;12;[@Period]-1);1)
I need to replicate exacly the same in powerpivot creating a new column. Unfortunately all attempts I did resolved eitheir in sintax or in data error. For example the following:
= Table.AddColumn(#"Replaced Value", "Merged", each Text.Combine({"20", Text.From([FY], "it-IT"), Text.From([Period], "00"), "-01"}), type text)
produce data "error" in all records.
Many thanks,
C.
Hi, Anonymous
Thanks for your quick response!
When the [Period]=1, the date is the Dec in the last year.Here are the steps you can refer to :
We can click "Custom Column" and enter this:
if [Period]=1 then #date([FY]+2000-1,12,1) else #date([FY]+2000,[Period]-1,1)
Then we can modify the data type we want :
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Anonymous3 years agoNot applicable
Thanks Aniya, this did work!
Regards and thanks again!
C.