cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Animanga008
Helper II
Helper II

Grouping Month-Year Distinct by Year

I am having trouble reproducing this solution: https://community.powerbi.com/t5/Desktop/How-to-group-months-by-year-on-a-line-chart-visual-Axis/td-...

 

How do I display data over many years continuously, grouped by the months only, distinguished by the year; without using a legend or by using a calculated column that gives the dates column a quant value (like YEAR*100+Month*10=value and then sort by)? Or alternatively, I'm not looking to create a key table that separately gives a value to the summarized view of my data's dates.

 

I am just trying to reproduce these solutions but it's still grouping all the months together by name, not distinguishing between year.

 

Screenshot is my test example. I just used the calendar function to create values between two years and then randomly generated values.

Example.PNG

 

Example 2.PNG

 

Example 3.PNG

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

Hi@Animanga008

 

After switching off concatenate labels as:

1.png

then drill down like:

2.png

3.png

Here is the output:

4.png

If you want to learn more, please refer: How-to-change-the-granularity-of-date-in-X-axis 

 

 

Best Regards,
Caitlyn Yan

 

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

3 REPLIES 3
v-caitlyn-mstf
Community Support
Community Support

Hi@Animanga008

 

After switching off concatenate labels as:

1.png

then drill down like:

2.png

3.png

Here is the output:

4.png

If you want to learn more, please refer: How-to-change-the-granularity-of-date-in-X-axis 

 

 

Best Regards,
Caitlyn Yan

 

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

amitchandak
Super User
Super User

@Animanga008 ,

Either you have these columns and use those

 

Month Year = FORMAT([Date],"mmm-yyyy")
Month Year sort = FORMAT([Date],"yyyymm")

 

And use on x-axis

or

 

Month= FORMAT([Date],"mmm")
Month sort = month([Date])

 

Then have Year and Month on x-axis, sort on them. Uncheck concatenated labels. and try

refer the power bi part of this video - https://www.youtube.com/watch?v=2P5BBRN853c

 

Concat Label Off.pngConcat2.png

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

So the first proposed solution I know works for sure, because you're effectively giving the different years and months a quant value.

 

Your second proposal addresses what I'm asking.

 

My questions are:

 

1) Any idea why I can't get my year buckets to appear (2020, and 2021)?

2) What do you do with creating a Month name field (Month= FORMAT([Date],"mmm")) and then a Month digit field (

Month sort = month([Date]))? I don't understand how those two values are used to sort across various years.

 

Example 6.png

 

Example 5.PNG

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!