Forum Discussion

graceweii's avatar
graceweii
Frequent Visitor
5 years ago
Solved

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. 

 

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. 

 

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

  • Anonymous's avatar
    Anonymous
    5 years ago

    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

2 Replies

  • nvprasad's avatar
    nvprasad
    Icon for Solution Sage rankSolution 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

  • Anonymous's avatar
    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