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

Month number Vs Month name // Chart based on date hierarchy

Hi

 

In a chart with x-axis being a date hierarchy I would like to display the month number Vs the month name.

 

Thank you in advance

14 REPLIES 14
Pragati11
Super User
Super User

HI @AlexDT ,

 

I am not clear on what you mean by Month number vs month name.

Do you want both Month number and Month name on x-axis?

Do you just want Month Number in the x-axis?

Try adding some screenshot on what the requirement is.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

The months are displayed as January, February, etc..

 

I would like 1, 2, etc..

Hi @AlexDT ,

 

You can do that by creating a column using DAX in Power BI.

Month Number = MONTH('Supermarket Sales'[Date])

Then move this column in place of month name on your chart. Something like below:

Pragati11_0-1645019751023.png

Let me know if this helps.

 

 

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thank you Pragati,

 

I wrote my issue was when displaying months on a date hierarchy.

Hi @AlexDT ,

 

You will need to few steps for it as shown in the video below:

t3.gif

What I have basically done is:

  • Started with date Hierarchy in my chart.
  • Removed Month and Day part of the hierarchy
  • Moved Month Number to the hierarchy
  • As I need Day as well, moved date hierarchy again by just keeping DAY part of it

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thank you very much.

 

I've tried this already but then I don't have the same display and drill drown options, such as selecting only one year by clicking the year number in the chart.

The final result should be like this but with month numbers.


Capture.PNG

 

Thank you again

Hi @AlexDT ,

 

Go to formatting options for this chart --> under x-axis --> turn off Concatenate labels

You will something like this:

Pragati11_0-1645022756768.png

You can play around with other formatting options there like gridlines.

My chart shows drill-down to DAY level.

 

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thank you for this,

 

Concatenate labels is off but this is not working, I have still the data as merged (year and month numbers)

 

Then by doing this I can't see anymore the empty values, even the box is ticked for each component.

 

Capture2.PNG 

 

 

HI @AlexDT ,

 

Did you switch off concatenate labels off for x-axis?

I see that working on my side.

Can you show me what you are moving to this visual?

Like I have this:

Pragati11_0-1645025907092.png

Also can you share me this setting for your chart:

Pragati11_0-1645026834199.png

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Scrennshots below :

 

 

Capture4.PNGCapture3.PNG

Hi @AlexDT ,

 

What are these fields here?

Pragati11_0-1645027189152.png

I would assume a Date Hierarchy with YEAR, Quarter, Month Number, Day.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Fiscal startdate

Année

 

=>are years (auto date hierarchy)

 

Fiscal month

 

=>is my calculted month number

 

Fiscal sartdate

Jours

 

=> Are adys (auto date hierarchy)

 

My original question is to replace month name by month number in a chart with date hierarchy and to keep all the functionalities (Drill drown, empty values and selection by clicking on years or months)

 

Thank you so much for your patience

Hi @AlexDT ,

 

Are the data-types correct for all the Year, month Number, day column calculations?

It seems to work at my end.

If possible, send me your pbix by removing any sensitive information. I can take a look then as it is hard to judge what is wrong at your end as it is working at my end.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @AlexDT ,

 

Can you please create a new thread for this second issue please as the thread originally was getting month Number on a chart which is already resolved.

As this is taking time so better having it as a new thread and accepting solution to the original thread's answer.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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