Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Akhil_1411
Helper IV
Helper IV

Need column with Rank by Date and by Empid

Hi All,

 

I am trying to create a Rank(Column) by date and by empid with a metric "EO%". Below is the expected result i am looking for.

 

DateEmp IDEO %Rank
1/1/202112310%1
1/2/20212320%2
1/3/202113430%3
1/4/202123440%4
1/5/202112323%3
1/6/20212322%2
1/7/202113454%4
1/8/202123411%1
1/9/20211237%3
1/10/2021233%2
1/11/20211348%4
1/12/20212342%1



Can someone help me with this.

 

Thanks,

Akhil.

1 ACCEPTED SOLUTION

Hello @Akhil_1411 

 

Can you please try this:

 

Sorting_Rank = 
	RANKX (
        FILTER(
			ALL(
				'Table'[Date]
				),
            'Table'[Date] = MAX('Table'[Date])
            ),
			[EO%], , ASC, Dense
			)

 

or this:

Sorting Rank = IF (
    HASONEVALUE ( 'Table'[Date] ), 
    RANKX ( ALL ( 'Table'[Date] ), [EO%], , ASC, Dense)
)

 

 

View solution in original post

3 REPLIES 3
themistoklis
Community Champion
Community Champion

@Akhil_1411 

 

Are you sure the rank you show in your message is based on Date and EMP_ID? Every row has a distinct date so in the rank there wouldn't be same values

 

Please try the following formula:

 

 

 

Sorting_Rank = 
	RANKX (
        FILTER(
			ALL(
				'Table'[Date], 'Table'[Emp_ID]
				),
            'Table'[Date] = MAX('Table'[Date]) &&
            'Table'[Date] = MAX('Table'[Date])
            ),
			[EO%], , ASC, Dense
			)

 

 

 

@themistoklis ,

 

Thanks for your response. I have made mistake😶 it will be on the one date there will be multiple employees. Corrected table as below.

DateEmp IDEO %Rank
1/1/202112310%1
1/1/20212320%2
1/1/202113430%3
1/1/202123440%4
1/2/202112323%3
1/2/20212322%2
1/2/202113454%4
1/2/202123411%1
1/3/20211237%3
1/3/2021233%2
1/3/20211348%4
1/3/20212342%1

Hello @Akhil_1411 

 

Can you please try this:

 

Sorting_Rank = 
	RANKX (
        FILTER(
			ALL(
				'Table'[Date]
				),
            'Table'[Date] = MAX('Table'[Date])
            ),
			[EO%], , ASC, Dense
			)

 

or this:

Sorting Rank = IF (
    HASONEVALUE ( 'Table'[Date] ), 
    RANKX ( ALL ( 'Table'[Date] ), [EO%], , ASC, Dense)
)

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.