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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
yosedesh
New Member

Consistent Date X-Axis in Line Chart

Hello:

 

I'm trying to display a trend line using a line chart for various Users.  The line chart defaults to showing the number of records for over 250 Users, but there is a User slicer so that people can choose to view the trend lines for specific Users.  The data snapshot is taken every 2 weeks.  Some Users might have a few records during certain time and no record at other times.  For example, the User below only had 1 record in mid October 2023, 3 records in beginning of Nov, 2 records at beginning of December, and 1 record in mid December:

 

yosedesh_0-1707327358521.png

 

However, since the data snapshots are actually from Oct. 1, 2023 up to today's date, we want the line chart to show from Oct. 1, 2023 to February 2024 even though this specific User had no record in the beginning/end.  In other words, the x-axis should show Oct. 2023 through Feb. 2024.  Ideally, the y axis should show 0 as the minimum.  For example:

 

yosedesh_1-1707328262772.png

 

This way, the date x-axis line graph will stay consistent from Oct. 2023 to today's date for all users.  Some users will have records in the whole date range.  We still want to show the whole date range even for those who do not have any record at the begnning / end of the date range. 

 

Is this possible?

 

Thank you in advance!

2 ACCEPTED SOLUTIONS
v-junyant-msft
Community Support
Community Support

Hi @yosedesh ,

You can accomplish this desired result in the settings of the line chart:
For example:
This is what the line chart looks like:

vjunyantmsft_0-1707355244197.png

Click the line chart, and make the settings as shown in the figure below:
Set start date to 2023/10/1:

vjunyantmsft_1-1707355445983.png

Use this DAX to create a new measure and set the end date to today:

Today = TODAY()

vjunyantmsft_2-1707355566038.png

The final output is as below:

vjunyantmsft_3-1707355603175.png

 

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @yosedesh ,

Sorry when I review my reply, I find that I forgot to set the y-axis to start at 0. I changed the previous pbix file:

vjunyantmsft_0-1708507731001.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-junyant-msft
Community Support
Community Support

Hi @yosedesh ,

You can accomplish this desired result in the settings of the line chart:
For example:
This is what the line chart looks like:

vjunyantmsft_0-1707355244197.png

Click the line chart, and make the settings as shown in the figure below:
Set start date to 2023/10/1:

vjunyantmsft_1-1707355445983.png

Use this DAX to create a new measure and set the end date to today:

Today = TODAY()

vjunyantmsft_2-1707355566038.png

The final output is as below:

vjunyantmsft_3-1707355603175.png

 

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @yosedesh ,

Sorry when I review my reply, I find that I forgot to set the y-axis to start at 0. I changed the previous pbix file:

vjunyantmsft_0-1708507731001.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

d_rohlfs
Resolver I
Resolver I

Hey @yosedesh,

Just use a Date Dimension Date as your X Axis so that you get all of the dates. You may need to right click on the date field inside of the visual pane and select show items with no data. You may also need to add a date slicer so that you don't see all dates inside of your date dimension. 
Here is a link to a public date dim from the company I work for:
Why Create a Date Table in Power BI? : :: Welcome To EPM Strategy ::

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.