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
sbharti123
Frequent Visitor

how to specify start range in x-axis for categorical type.

I am trying to create a line chart with "Years" on x-axis, from 2015-2019. For each employee a separate chart is being created. 

 

Each line in the chart represents certain categories and I have to put markers on them. Which is why I want to do it this way.

 

When I convert x-axis type to categorical, for those employees which joined recently, their years from 2015-2018 are missing, the axis only shows 2019 year. 

 

I can fix this in continuous type by specifying starting range for x-axis. Any idea how to do the same for categorical type of x-axis. 

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @sbharti123 

Just enable Show items with no data in Power BI as below:

https://docs.microsoft.com/en-us/power-bi/desktop-show-items-no-data

And you could use a dim date table then create a relationship with data table and then Show items with no data.

 

Best Regards,

Lin 

 

Community Support Team _ Lin
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-lili6-msft
Community Support
Community Support

hi, @sbharti123 

Just enable Show items with no data in Power BI as below:

https://docs.microsoft.com/en-us/power-bi/desktop-show-items-no-data

And you could use a dim date table then create a relationship with data table and then Show items with no data.

 

Best Regards,

Lin 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lin,

 

Thank you so much, that was so easy. I created a date dimension table, which has all the years that I require (or the ones in my data already). Then rather than having the x-axis as the 'year' from the fact table, I used the 'year' from this new date dimension table.

 

After that I enabled Show items with no data on the Year, and that fixes everything. 

Thak you so much for your support.

 

Regards,

Sumit

Anonymous
Not applicable

@sbharti123 

Are you using a date table which is linked to your data table? If you have specified your year figures directly in the data table there will be missing info unless data is there for the selected period. 

Thanks.

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.