Forum Discussion

Ria's avatar
Ria
Frequent Visitor
10 years ago

Date Hierarchy

Sometimes when I create a visualization in Power BI desktop with date and sales data, it automatical sets it up with the date hierarchy.  I had one visualization set up this way and then added a new data base that had dates in it.  I used the date to manage the relationships. Now my visualization has changed so that the hierarchy option on the date is no longer available.  What do I need to do to change it back again?

5 Replies

  • fedin's avatar
    fedin
    Regular Visitor

    Sorry if doing this wrong as this is my first time here :).

     

    Indeed the problem appears when you add the date column to a relationship. Assume I had a table called "theTable" with a date column called "DateCol". My solution was to create a new calculated column "DateCol2 = [theTable]DateCol" and then replace DateCol with DateCol2. Using DateCol2 I got my hierarchy back.

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Make sure your column is definitely datetime type and format. When you drag the item to the axis you should have additional settings in the area where you dropped your date. Also in the painter settings for the visual, choose continuous rather than categorical on the axis settings.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Does it help if I say hierarchy works with bar chart but not with line charts ?

      In line charts I get only hierarchy for years. If I simply convert this line chart to bar chart, I get the whole hierarchy.

      • asocorro's avatar
        asocorro
        Skilled Sharer

        Only the year appears because you cannot drill-down on a line chart.

    • Lucy64's avatar
      Lucy64
      Advocate II

      I have the same issue where I cannot drill down through the date, it is set as date/time with the format as m/d/yyyy.  The same format as I have for another dashboard (different data source) where the drill down works.  What am I missing?