Forum Discussion

Noak's avatar
Noak
Helper IV
9 years ago
Solved

Date Hierarchy issues

Hello,

I'm working on a big report including dates from 2016 and 2017,

for some reason the date hirrarchy mixes dates from Q1 2016 and 2017.

I would like to present 5 Quarters, Q1 2016 Q2 2016 Q3 2016 Q4 2016 Q1 2017 -  the data is dynamic so the solution should be permanent.

 

  • Noak's avatar
    Noak
    9 years ago

    Hi,

    here's a quickest  solution - calculated column

    Year-Quarter = CONCATENATE( [createdon].[Year]," " & [createdon].[Quarter])

     

    thank you for your help.

3 Replies

  • dkay84_PowerBI's avatar
    dkay84_PowerBI
    Microsoft Employee

    A hierarchy is for drill down, so in your case, you would have columns that aggregate for year, and when you drill down it show Q1-4 of that year.  In order to show all the quarters by year, you could expand the hierarchy (forked arrow at top right of visual).  However, if your "createdon" field spans more than the time you wish to show in your chart (Q1 2016 through Q1 2017), I recommend creating your own date table.  Then, create your date fields (i.e. "Year", "Month", "Qtr" etc) and include a Quarter Year key (concatenate the quarter and year) as well as a Quarter Year sort field ("Year" * 10 + "Quarter").  This will allow you to create your own hierarchy but filter the visual to only show the quarters you want.  The sort field allows you to sort the axis so that it isn't sorted alphabetically.

  • dkay84_PowerBI's avatar
    dkay84_PowerBI
    Microsoft Employee

    Forgot to mention that you can make this dynamic by having your date table reference the earliest and latest dates in your "CreatedOn" field so that the date table always gives you the necessary range.  If you need the range to extend further, than you can either hard code it or use the latest date and add to it, depending on your use case.

     

    As for the date hierarchy mixing dates, please provide some additional info so we can discover what is going on.

    • Noak's avatar
      Noak
      Helper IV

      Hi,

      here's a quickest  solution - calculated column

      Year-Quarter = CONCATENATE( [createdon].[Year]," " & [createdon].[Quarter])

       

      thank you for your help.