Forum Discussion

llealsantos's avatar
llealsantos
Frequent Visitor
2 years ago
Solved

Rank function on selected dates

We need to apply conditional formatting to identify the top 5 and bottom 3 values in a dataset, based on user-selected fiscal periods. The selection can include non-continuous fiscal periods, and the ranking should be recalculated to ignore any periods that are not selected. 

Users can select any combination of fiscal periods. This selection can include continuous periods (e.g., 2024 P05, 2024 P04, 2024 P03) or non-continuous periods (e.g., 2024 P04, 2023 P11, 2022 P03).

The ranking should dynamically adjust based on the selected periods. For example, if the user selects 2024 P05, 2023 P05, and 2022 P05, the ranks should be recalculated as 1, 2, and 3 based on the values for these periods alone, not the entire dataset. This ranking should ensure that the top 5 and bottom 3 values are identified correctly based on the user's selection.

To represent the top 5 and bottom 3 values I will use conditional formatting, so after ranking the periods correctly, it should return 1 for the top 5 values and 2 for the bottom 3.

 

 

The fiscal periods are stored in the Calendar[Year Period] column.

The format of fiscal periods is YYYY PXX, for example, 2024 P05 for the 5th period of the year 2024.

We have a Fiscal Calendar Table that has columns for Year, Beginning Date, Ending Date and Period Number.
We have measures for all KPIs.

Is this possible?

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    please check the rankx function what I have used on the dataset.


    Please check the final output.

    If you think that this helps you then accept this as your solution.

6 Replies