Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Nastja88
New Member

Advanced line chart shows "ugly" dates

Hi, 

 

I have a visualization below (Advanced Line Chart (Pro)) and I would like to have prettier labels on the x-axis: just dates (without time) and not necessarily every date.    

 

Nastja88_0-1683802882956.png

 

I tried changing the type of x-axis from Auto to Date, but I got an empty visualization with dates in year 2000, even though I have data from April 2023.

Nastja88_2-1683803292255.png

 

 

Nastja88_1-1683803224910.png

 

Data for visual:

Nastja88_3-1683803847887.png

 

Relevant data looks like this (DateTime has type "Date/time", SimulationID "Whole number", Actual and Forecast "Decimal number"): 

 

DateTimeSimulationIDActualForecast
30/04/2023 00:001086116634.8315961.49
30/04/2023 00:001104516634.8315839.35
30/04/2023 01:001086115870.415163.19
30/04/2023 01:001104515870.415043.59
30/04/2023 02:001086115421.9214531.76
30/04/2023 02:001104515421.9214405.2
30/04/2023 03:001086114843.0614003.39
30/04/2023 03:001104514843.0613885.02
30/04/2023 04:001086114510.6313492.57
30/04/2023 04:001104514510.6313383.25
30/04/2023 05:001086114543.7212737.51
30/04/2023 05:001104514543.7212654.43
30/04/2023 06:001086114735.512751.7
30/04/2023 06:001104514735.512594.7
30/04/2023 07:001086115345.4213805.14
30/04/2023 07:001104515345.4213476.23

 

I would really appreciate any help.

1 ACCEPTED SOLUTION
Nastja88
New Member

None of the suggested methods produced the result I wanted. So I made a workaround and saved the data in another way:

  • forecasted and actual values are in the same column,
  • another simulation ID is added for the actual.

Then I used basic "Line chart" visualization to display the data.

 

Nastja88_0-1684312472676.png

 

View solution in original post

6 REPLIES 6
Nastja88
New Member

None of the suggested methods produced the result I wanted. So I made a workaround and saved the data in another way:

  • forecasted and actual values are in the same column,
  • another simulation ID is added for the actual.

Then I used basic "Line chart" visualization to display the data.

 

Nastja88_0-1684312472676.png

 

fernandarebello
Regular Visitor

Try this:

In the report, select your column that corresponds to your date.
then, in "Column tools", change de "format type" as you prefer.

fernandarebello_0-1683895011399.png

 

PoweredOut
Resolver I
Resolver I

Do you need the timestamp date? You can either convert this to a date in Power Query or duplicate it in a new column and convert to date. It could be that you will need to convert it to date/time first before date. 

 

If you have Auto/Date Time turned on, it will create a Hierarchy for you. You can then add Year, QTR, Month or Day to the visual 

 

Thank you for your reply, with this I managed to make a graph on a daily granularity (where I have a column only with dates), which I also need.

 

But I would also need to have it on hourly granulation. If I try the same for hourly granularity, I get the error bellow: 

Nastja88_0-1683806252715.png

 

Using the Timestamp column, Go to add column tab and Extract text after delimiter. The delimiter will be the a empty space. Just click on the keyboard once.

 

When the new column is created, in the Transform tab, click on extract first characters and choose 5. This will leave you with the time. Convert the column to time. You can then add this to the Matrix as a hierarchy 

I tried using your method and used hierarchy of Date and Time: 

Nastja88_0-1683888279284.png

And I get even longer x-axis labels, also the dates aren't correct anymore: 

Nastja88_1-1683888342659.png

Previous version: 

Nastja88_2-1683888369003.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.