Forum Discussion

Revealer's avatar
Revealer
Frequent Visitor
3 years ago

Financial Year week sort

In matrix visual Fiscial year week number currect weeknumber have display first in order.

kindly help me i am getting asc,desc order only like 1-52,52-1 it is displaying

2 Replies

  • MAwwad's avatar
    MAwwad
    Icon for Solution Sage rankSolution Sage

     

    To display the current week number first in a matrix visual in Power BI, you can use a calculated column to identify the current week and then sort the matrix visual by this column.

    Here is an example of how you could create a calculated column to identify the current week:

    1. Click on the "Modelling" tab in the ribbon and select "New Column" from the "Columns" dropdown.

    2. In the "New Column" window, enter a name for the calculated column, such as "Current Week".

    3. In the "Formula" field, enter a DAX expression to identify the current week. For example, you could use the WEEKNUM function to determine the week number for the current date, and then use the IF function to check if the week number is equal to the current week number.

      Here is an example of a DAX expression that you could use:

       

      Copy code
      Current Week = IF(WEEKNUM(TODAY()) = WEEKNUM([Date]), 1, 0)
       

      This expression will return a value of 1 for the current week and 0 for all other weeks.

      To sort the matrix visual by the calculated column, click on the "Sort By Column" option in the Visualizations pane and select the "Current Week" column as the sort column. Set the sort order to "Descending" to display the current week first.

      I hope this helps! Let me know if you have any further questions or if you need further assistance.

    4.  

    5.  

  • Revealer's avatar
    Revealer
    Frequent Visitor

    Hi,

       when i am using the below code means order is coming like this

     

    but have to display order like this(eg)38,37,36