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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
blockobito
Helper I
Helper I

How to Show months within the next 6 months in Bar Graph

How to Show months within the next 6 months in Bar Graph even without data on excel?

Barchart Count for Example 

October 2022  - 300 

November 2022 - 300

December 2022 - 250

January 2023 - 100

February  2023 -  0 

March 2023 - 0 

 

When i create a bargraph it only shows October to January. Since February March has no data or its not on the excel. 

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

Hi @blockobito ,

 

Step1: Create a calendar table that contains all dates you need.

calendar = calendar(startdate,enddate)

CALENDAR function (DAX) - DAX | Microsoft Learn

Step2:

Create a relationship between fact table and calendar table.

Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

Step3:

Use calendar date as x-axis and enable the show items with no date feature.

Show items with no data in Power BI - Power BI | Microsoft Learn

Step4:

Set relative date filter for the visual.

Use a relative date slicer or filter in Power BI - Power BI | Microsoft Learn

 

Best Regards,

Jay

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @blockobito ,

 

Step1: Create a calendar table that contains all dates you need.

calendar = calendar(startdate,enddate)

CALENDAR function (DAX) - DAX | Microsoft Learn

Step2:

Create a relationship between fact table and calendar table.

Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

Step3:

Use calendar date as x-axis and enable the show items with no date feature.

Show items with no data in Power BI - Power BI | Microsoft Learn

Step4:

Set relative date filter for the visual.

Use a relative date slicer or filter in Power BI - Power BI | Microsoft Learn

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Shaurya
Memorable Member
Memorable Member

Hi @blockobito,

 

You should the month field from your date table instead of the values table. Make sure you have a many to one single directional filter from 'Values' to 'Date'. Then choose the range to be shown and you should be able to see months without data.

 

Screenshot 2022-10-24 163825.jpg

 

Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Previous Forecasts

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.