Forum Discussion

Evelyn_L's avatar
Evelyn_L
Frequent Visitor
2 years ago
Solved

Sort Martix by column

I'm currently using the sort option to organize data, but it's sorting based on the values across all months. Instead, I want to sort data by the selected month specifically. For example, if I select January and sort in descending order, it should display values like 29508, 20484, 17844, 10368, etc. Similarly, if I select February and sort, it should show 29748, 10596, 9684, 9468, etc.

Is there a way to achieve this?

  • Hi Evelyn_L - Use below measure to sort the value dynamically as per selection of month:

     

    Here i have a seperate date table connected to my financial table date column , 

     

    Measure:

     

    SelectedMonthValue =
    VAR SelectedMonth = SELECTEDVALUE('DateTable'[Month])
    RETURN
        CALCULATE(
            SUM(financials[Profit]),
            FILTER(
                financials,
                FORMAT(financials[Date], "mmmm") = SelectedMonth
            )
        )

     

     

    sort the matrix visual with selectdmonthvalue

     

    it works. please check

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!

     

     

     

     

1 Reply

  • Hi Evelyn_L - Use below measure to sort the value dynamically as per selection of month:

     

    Here i have a seperate date table connected to my financial table date column , 

     

    Measure:

     

    SelectedMonthValue =
    VAR SelectedMonth = SELECTEDVALUE('DateTable'[Month])
    RETURN
        CALCULATE(
            SUM(financials[Profit]),
            FILTER(
                financials,
                FORMAT(financials[Date], "mmmm") = SelectedMonth
            )
        )

     

     

    sort the matrix visual with selectdmonthvalue

     

    it works. please check

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!