Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to Automatically differentiate the date without "Year" at last.

Hi All,

 

Need some suggestions and Help,

 

I am Having a data with has date in the format (DD.MM) without the year but the dates ranges from Current to Future , When we load the same PowerBI only considering the Data as only Current Year.

 

 

 

Can anyone tell how to How to make the transformation so that Powerbi will differentiate the Dates with Year.

 

Thanks 

Sukanya S

3 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    You could unpivot the columns to get the dates in one column.

    Then add an index.

    If the cutoff is 31.12, you could note the index value of this (might be 365 if you have a whole year of current data) and add a year column with an 'if' statement dependent on the index being higher or lower than the 31.12 index (e.g.365).*

    Then merge the day/month column with the year column to get a valid date column.

    ----

    * -> with more work this could be dynamic i.e. not comparing to a hardcoded value but at least you could prove the algorithm by hardcoding it.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks HotChilli  I will check and execute let you the status as well 

      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        Hi Anonymous 

         

        Have you got the solution? Any update?

         

        Best Regards,
        Community Support Team _ Jing