Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
1 year ago
Solved

X-axis using field parameter

Hello everyone

I currently have a data board in which I have generated columns to calculate daily and monthly indicators according to casuistry.

In order not to generate too many tabs I have generated a field parameter using the date column (dd/mm/yyyy) and the month name, and I am using this parameter as the X-axis in my charts.

But I have the question that if it is possible that when using the field parameter on the X axis and selecting the case of the month name order it correctly by time.

Attached image of the values of the date and month name columns that were passed in the field parameter

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from shafiz_p , please allow me to provide another insight:

    Hi, Syndicate_Admin 
    Thanks for reaching out to the Microsoft fabric community forum.

    Has shafiz_p's response resolved your issue? If it has, please accept it as the solution. This will help other users with similar problems find solutions more quickly.

    In my tests, it was effective. Below is an image of my results:

    To generate a month number column, you can use the MONTH() function to create a calculated column. In my tests, this did not result in any circular dependency issues.

    MONTH function (DAX) - DAX | Microsoft Learn

     

    For more details on shafiz_p's solution, you can refer to the following documentation:

    Sort one column by another column in Power BI - Power BI | Microsoft Learn

     

    Please find the attached pbix relevant to the case.

     
    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

2 Replies

  • Hello, chart basically sort text field in alphabetically order (e.g., April, August, December...). To sort by time or chronological order, you need to overrid alphabetical sorting behaviour.

     

    To achieve this, need a month number column and sort month name by month number column. Here is how:

     

    After that, field parameters dynamically switch between fields while retaining their underlying sort logic.

     

     

    Hope this answered your question!!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from shafiz_p , please allow me to provide another insight:

    Hi, Syndicate_Admin 
    Thanks for reaching out to the Microsoft fabric community forum.

    Has shafiz_p's response resolved your issue? If it has, please accept it as the solution. This will help other users with similar problems find solutions more quickly.

    In my tests, it was effective. Below is an image of my results:

    To generate a month number column, you can use the MONTH() function to create a calculated column. In my tests, this did not result in any circular dependency issues.

    MONTH function (DAX) - DAX | Microsoft Learn

     

    For more details on shafiz_p's solution, you can refer to the following documentation:

    Sort one column by another column in Power BI - Power BI | Microsoft Learn

     

    Please find the attached pbix relevant to the case.

     
    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu