Forum Discussion

mkz81's avatar
mkz81
Frequent Visitor
1 year ago
Solved

How to build line chart date and time based?

Hi! I'm trying to build a line chart where X-axis would be date and time binded. Although I've built date and time tables my chart doesn't represent data sequentially i.e. date and time based. Instead it devides data by date/time i.e. shows all values associated with particular date/time. What am I missing? How to ensure the chart would represent values continiously? Thank you! 

PowerBI file 

 

 

  • Having separate Date and Time columns is very good practice for exactly the reason I mention (the blue "i"). But if you want a continuous X axis (as you seem to imply) then the continuous value column is your only good option.

     

    Try not to fall into the trap of attempting to dictate to your report users how they should navigate your report UI. Embrace the Power BI way of doing things.

4 Replies

  • mkz81 

    Combine Date and Time into a Single Column

    DateTimeCombined = 'Table'[Date] + 'Table'[Time]

    Go to the "Format" pane for the line chart.
    Under "X-axis," set the type to Continuous.

     

    Make sure DateTimeCombined is added to the X-axis.
    Ensure that the Values field of the chart uses the correct aggregation (e.g., Sum, Average, etc.).

     

    💌 If this helped, a Kudos 👍 or Solution mark ✅ would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn

  • Yeah, tough.  You'll need to make compromises. 

     

    Use a DateTime column for the continuous X axis and let the visual handle the axis legend.  Use Zoom Sliders for a better UX.

     

    NOTE:  Blue "i"  - too many data points.

     

     

    • mkz81's avatar
      mkz81
      Frequent Visitor

      Hi Ibendlin! Thank you for the proposal! I actually split the time/date column hoping to use my Date and Time tables. Is there a way of doing it instead of using concatenated column?

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Having separate Date and Time columns is very good practice for exactly the reason I mention (the blue "i"). But if you want a continuous X axis (as you seem to imply) then the continuous value column is your only good option.

         

        Try not to fall into the trap of attempting to dictate to your report users how they should navigate your report UI. Embrace the Power BI way of doing things.