New to powerBI have date field on x axis but not showing in date order

  • New to powerBI have date field on x axis but not showing in date order

    Posted by DSC Communities on June 26, 2019 at 9:42 am
    • may Leese

      Member

      June 26, 2019 at 9:42 AM

      I am new to powerbi and have created a simple chart with date filed (weekly) on the x axis, but this is not showing in date order, how can I change this?

      ——————————
      may Leese
      Analyst
      07716020880
      ——————————

    • William Rodriguez

      Member

      June 26, 2019 at 10:17 AM

      Hi :

      The remedy is to ‘sort the column’. The following two videos should get you going in the right direction.Ā 

      Microsoft Video:Ā https://www.youtube.com/watch?v=dk6FJFVkdHs

      Pragmatic Works Video: https://www.youtube.com/watch?v=fUnOfrSjxCU

      (I think the Pragmatic one will be more helpful)
      William

      ——————————
      William Rodriguez
      Business Analyst | MCSA: BI Reporting
      ——————————
      ——————————————-

    • David Gerard

      Member

      June 27, 2019 at 3:39 AM

      Hi May Leese,

      Use the “Sort by column” feature in the ribbon. Basically, you sort one column by another. In one column you list your weeks, and in a second column you list the order in which you want your list to show up.


      Hope that helps. Let us know

      ——————————
      David Gerard
      Buisness Intelligence Consultant
      Kampala
      779152992
      ——————————
      ——————————————-

    • Christopher Majka

      Member

      June 27, 2019 at 9:10 AM

      Is your date field of Date data type or is it number or text?

      ——————————
      christopher majka
      Manager, Business Intelligence
      4018682000
      ——————————
      ——————————————-

    • Tim Dyeson

      Member

      June 27, 2019 at 10:17 AM

      ?Hi May,
      A couple of questions: Is your date column formatted as a date or is it a text field? If it’s text, then it will not sort properly on it’s own. Are you using a date table in your model? We use a custom date table in all of our data models to be able to control the X axis in many ways.

      I typically use a text value in my X axis to display months (e.g., Jan-2019) and have to use the “Sort by Column” feature in the Modeling ribbon.

      If you are not able to get the date to sort properly, you may want to create a date table with a WeekOfYear colum to sort it (screen shot below).

      I’ve attached an Excel date table and a PBIX that loads it. You will just have to change the Source path.

      Screen Shot of Date and WeekOfYear

      ——————————
      Tim Dyeson
      Performance Measurement Manager
      WA State Health Care Authority
      ——————————
      ——————————————-

    • Nancy Peterson

      Member

      June 28, 2019 at 8:35 AM

      If you click on the visual you have created, there are the three dots in the corner for more options. One of the options is to set the sort order.

      ——————————
      Nancy Peterson
      Senior Business Analyst
      Pitsco Education
      Pittsburg KS
      ——————————
      ——————————————-

    • Ethan Owens

      Member

      July 9, 2019 at 10:45 AM

      Hi May,Ā 

      Ā  Ā  Ā Normally when I create a date dimension, I have a fully qualified date field and other descriptive fields.Ā  Below is a DateDimension I created using DAX:

      DIM_DateDax =
      VAR BaseCalendar = CALENDARAUTO()
      RETURN
      GENERATE (
      BaseCalendar,
      VAR BaseDate = [Date]
      VAR YearDate = YEAR ( BaseDate )
      VAR MonthNumber = MONTH ( BaseDate )
      VAR MonthName = FORMAT ( BaseDate, “mmmm” )
      VAR YearMonthName = FORMAT ( BaseDate, “mmm yy” )
      var Quarter = CONCATENATE(“Q”,roundup(Month(BaseDate)/3,0))
      var WeekNumber = WEEKNUM(BaseDate,2)

      RETURN
      ROW (
      “Year”, YearDate
      ,”MonthNumber”, MonthNumber
      ,”MonthName”, MonthName
      ,”YearMonth”, YearMonthName
      ,”QuarterName” , Quarter
      ,”WeekNumber”, WeekNumber
      )
      )

      Once the dimension is loaded, I go to the modeling tab, Sort by Column, and sort MonthName by MonthNumber.Ā  This allows you to use text fields rather than dates should you choose to do so.

      ——————————
      Ethan Owens
      45459
      Centerville
      9373291211
      ——————————
      ——————————————-

    DSC Communities replied 6 years, 2 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘New to powerBI have date field on x axis but not showing in date order’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!