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

Displaying previous years and current months in X-Axis

Hello,

 

I am trying to build a bar chart which would look like the one below: 

 

KK111_0-1646406034913.png

How can I display previous years and months for current year in the same chart? 

 

Thank you. 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @KK111 ,

 

According to your description, you can convert some of your date columns and refer to the following test results.

col_date =
IF (
    YEAR ( 'Table (2)'[Date] ) = 2019,
    FORMAT ( 'Table (2)'[Date], "yyyy" ),
    FORMAT ( 'Table (2)'[Date], "yyyy-mm" )
)

vhenrykmstf_0-1646709446287.png

vhenrykmstf_1-1646709461871.png

 


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

7 REPLIES 7
parry2k
Super User
Super User

@KK111 all 3 videos are out and here is the link to 3rd video https://youtu.be/89kbpmSbyDw



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.

parry2k
Super User
Super User

@KK111 first video of 3 part video is out, and your question will be answered in 3rd video, most likely will be out this Sunday (March 13th)

 

Let's learn how we can do some unusual stuff in Power BI - Let's mix granularities - Part 1 - YouTub...



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.

parry2k
Super User
Super User

@KK111 Just to let you know I'm working on a video on how to achieve this. It is going to be 3 part videos, step by step, starting tomorrow (March 11th), and video 3rd in this series will answer your question. it is not that you need 3 videos but I'm addressing a larger concept and your question will get answered from this concept. 



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.

v-henryk-mstf
Community Support
Community Support

Hi @KK111 ,

 

According to your description, you can convert some of your date columns and refer to the following test results.

col_date =
IF (
    YEAR ( 'Table (2)'[Date] ) = 2019,
    FORMAT ( 'Table (2)'[Date], "yyyy" ),
    FORMAT ( 'Table (2)'[Date], "yyyy-mm" )
)

vhenrykmstf_0-1646709446287.png

vhenrykmstf_1-1646709461871.png

 


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

parry2k
Super User
Super User

@KK111 Thanks for your patience, I will try to have it this week. Sorry for the delay.



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.

parry2k
Super User
Super User

@KK111 I'm working on doing a video on something similar and I expect it to be out soon. Do subscribe to my YT channel to get notified when this is out.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

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

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 



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.

KK111
Frequent Visitor

Hi @parry2k ,

 

Thank you. I am checknig your chanel every day for this video, becasue I really need to learn how to display previous years and current months on the same chart.  Thanks ! 

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!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.