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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
KarineDol
Frequent Visitor

year-month in a visualization

Hi, i am trying to build a graph with year-month in the x but as i have a jerarchy i have to choose year or month. I want to see both because i have information of different years, for example, from 2020 june to 2021 june....How can i do? I want to see it by month.

I dont want the drill down.

Thanks

 

 

 

 

 

 

 

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi  @KarineDol 

the general solution is to create a calendar table, then build relationship between your dimension table and fact table.

https://community.powerbi.com/t5/Desktop/Calendar-Table/m-p/1860460

vxiaotang_1-1628586945352.png

result:

vxiaotang_0-1628586932067.png

 

 

 

Best Regards,

Community Support Team _Tang

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

mahoneypat
Microsoft Employee
Microsoft Employee

You need to create a YearMonth column in your Date table with something like FORMAT('Date'[Date], "yyyy mmm").  FYI that this article has DAX you can copy to get a table with that.  It also has special hidden characters so that they show in the correct order in your visual (w/o a Sort By column).  Note you may have to replace the minus signs in the code as it didn't render correctly on the web site.

No Sort Date Tables! – Hoosier BI

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors