Forum Discussion

srajeshnkl's avatar
srajeshnkl
Regular Visitor
9 years ago
Solved

Power BI : Rank based on date Month wise

Hi Folks,

 

I have a table with below columns,  (Represents data of idea implementation)

 

S.No

Name

Idea Name

Implemented Date

 

The data is for whole year. I want to give Rank to the persons based on the "Implemented Date" for each month.Person implements a idea first on that month will get Rank 1. For example if Person X implements idea on 1-Jan-2017 then X gets rank 1 on January the same way if Person Y implements idea on 1-Feb-2017 then Y gets rank 1 on month Febrary . In this way I want to give rank for all persons on each month. How can I use RankX function in power BI to achieve this?

 

Please help me.

 

Below is the example data and Rank should be automatically calculated for each month like below

 

S.NoName Implemented dateRank
4Suganya1-Jan-171
5Vanitha2-Jan-172
6Sangeetha4-Jan-173
8Ravikumar8-Jan-174
1Sathish12-Jan-175
3Visagan13-Jan-176
9Ramesh19-Jan-177
2Rajesh22-Jan-178
10Harini25-Jan-179
7Sahana31-Jan-1710
12Rajesh1-Feb-171
16Sangeetha1-Feb-171
18Ravikumar1-Feb-171
13Visagan15-Feb-174
19Ramesh15-Feb-174
11Sathish18-Feb-176
14Suganya18-Feb-176
17Sahana18-Feb-176
20Harini18-Feb-176
15Vanitha21-Feb-1710


Regards, 

Rajesh S

  • Hi srajeshnkl

     

    You could try adding the following two calcuated columns

     

    MonthID = FORMAT('Table3'[Implemented date],"YYYYMM")
    Month = FORMAT(DATE(
                YEAR('Table3'[Implemented date]),
                MONTH('Table3'[Implemented date]),
                1),"MMM YY")

    Make sure you hide MonthID and set Month to be sorted by MonthID

     

    Then just drag the new Month column to the Column of a Matrix

     

     

     

     

  • Hi srajeshnkl,

     

    Have you tried the solution provided by Phil_Seamark above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

     

    If you still have any question on this issue, feel free to post here. :smileyhappy:

     

    Regards

6 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi srajeshnkl

     

    Any chance you can post some dummy data including what it should look like with the RANK based measure.

      • Phil_Seamark's avatar
        Phil_Seamark
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi srajeshnkl

         

        You could try adding the following calculated column to your table.   Just replace where I Table3 with your table name.

         

        New Rank = CALCULATE(
                        COUNTROWS('Table3'),
                        FILTER('Table3',
                            'Table3'[Implemented date] < EARLIER('Table3'[Implemented date])
                            && YEAR('Table3'[Implemented date]) = YEAR(EARLIER('Table3'[Implemented date]))
                            && MONTH('Table3'[Implemented date]) = MONTH(EARLIER('Table3'[Implemented date]))                       
                            ))+1