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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
graceweii
Frequent Visitor

How to create new measure with specific date time frame

The goal is to create a graph like the follownig. But the problem now is that I don't know how to create the x-axis dates. 

2021-08-25_11-35-10.jpg

 

The garph is basically by year, but by a specific time frame and it changes every month. For example, the currrent time is August 2021. So the columns from right to left should 08.2020-07.2021,  08.2019-07.2020,  08.2018-07.2019,  etc. Then, next month (Septmeber 2021), the columns from right to left should be 09.2020-08.2021,  09.2019-08.2020,  09.2018-08.2019,  etc.

 

 

The data source is a SSAS data cube, so I can't use Power Query. There is a date table in the model. 

2021-08-25_11-36-23.jpg

 

Thank you in advance! And I hope I explained the problem clearly. Please let me know if you need any more information. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @graceweii,

I'd like to suggest you create a custom column to grouping current date values into specific ranges and tagged them as you mentioned. Then you can use this field as the shared axis of your chart and the other two value fields for the y axis.

BTW, the new field is stored with text type, its sort order may not works the same as you wanted, you can refer to the following blog for custom sorting order of text values.

Custom Sorting in Power BI 
Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @graceweii,

I'd like to suggest you create a custom column to grouping current date values into specific ranges and tagged them as you mentioned. Then you can use this field as the shared axis of your chart and the other two value fields for the y axis.

BTW, the new field is stored with text type, its sort order may not works the same as you wanted, you can refer to the following blog for custom sorting order of text values.

Custom Sorting in Power BI 
Regards,

Xiaoxin Sheng

nvprasad
Solution Sage
Solution Sage

Hi,

 

The axis labels should come from any column of the table. You need to create a calculated column as per need then use that in the chart axis.

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Kudoed Authors