Forum Discussion
Show all Dates on continuous X axis
- 9 years ago
Hi kirill_vaynberg,
When you drag the date column to Axis of a line chart, it will automatically enable date hierarchy. You can check the column name instead of the Date Hierarchy. The date value in the X-axis will display based on the visual width and number of records in this date column. We are not able to set interval for date in the X-axis, we can just specify the start date and end date.
To display all date values in x-axis, the best option is to set X-axis type as Categorical, it will generate a horizontal scroll bar for us to view all data if there are two many records.
Best Regards,
Qiuyun Yu
I had same requirement: continuous dates on X-axis and event counts on Y-axis (0 to ....). to solve this I created a simple Calendar table with Dates in one column continuous from my start date to last date in my period under review - did this in Excel but of course can use other data source (Access, etc). Save or close the Excel before import. I am using PowerBI Desktop. Then Get Data, ensure Date format. Then Load query. Then link Calendar table to fact table in Relationships. Then in visual use Date from fact table and format x-axis as Continuous / Linear. Hope this helps. JL
I'd also like to add 3 things that are pretty obvious (though I missed them). These are small, but critical to ensure that this works:
1. Make sure your custom date table is set as the default date table. PowerBI defaults to its own date table until you define your own date table. Right click on your date table and choose "Mark As Date Table". https://docs.microsoft.com/en-us/power-bi/desktop-date-tables (Side note: you can also build your own Hierarchy from your date table Year > Quarter > Month > Week > Date)
2. Make sure the visual's X-axis is set to "Show Items With No Data" to make sure that days with no value are still included in the visual. Right click on the Axis field in the Fields list to do this.
3. Make sure your X-axis is set to Continuous. Click on your visual, then go to Format and expand the X-axis options.