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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Best approach to build a month value line chart

Hello,

For the last day I am trying a simple chart month by value for 15 months and always facing one of the following problems. Surprisingy I started to believe that Excel is much friendly than power bi... any way

When I import it from excel I get a problem that it does not show the month and the year on the chart and roll up months under one year, it also sum the same months ex Jan 19 and Jan 2020

 

I tried to manually input in power BI and found the following problems, I can sort the months in the chart any advices on what is the best approach?

Ca.PNGCapture.JPG

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Date.Month should help you in your scenario. To create a custom column in power query like that.

Date.Month([date])

dm.PNG

 

M code for your reference.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNQ3MAQipVgdGNcIiJRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "date"}}),
    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each Date.Month([date]))
in
    #"Added Custom"

 

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

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous you have to sort your month name column with another column and in that case it will be month number. here are the steps:

 

- add new column in the table

Month Number = MONTH ( Table[Date] )

- select month name column 

- go to column tools on the menu and select sort by

- from drop down choose month number 

 

and that will do it.

 

I would 💖Kudos 🙂 if my solution helped. If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k  I got the attached error. I just started learning to use the software yesterday, so I have no idea what even the formula that you gave me mean. I think I need to start working on it, but why did I get the error?

Hi @Anonymous ,

 

Date.Month should help you in your scenario. To create a custom column in power query like that.

Date.Month([date])

dm.PNG

 

M code for your reference.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNQ3MAQipVgdGNcIiJRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "date"}}),
    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each Date.Month([date]))
in
    #"Added Custom"

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

m.PNG

@Anonymous ok no problem, you are in query editor, add as a dax expression, and screen shot below. You can also do in power query but let's stay out of it for now.

 

image.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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