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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! 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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

Top Solution Authors