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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Zapas1428
New Member

Problems with apply condition to function RANKX

First of all, I would like to introduce myself and say that it is a pleasure to be part of the community. I started working with Power BI 7 months ago and I work in the industry.

 

I have a problem because I would like to make a ranking from 1 to the number of records registered that day and the next day restart the ranking from 1.

 

I have used the Rankx function but I am not able to restart it when changing the value of one of the two dates (there are two dates intentionally and they are well related).

 

I attach an image of the table layout:

Zapas1428_0-1629371844412.png

 

The formula I am using now is: Ranking by day = RANKX('Tabla Resumen Autobox','Tabla Resumen Autobox'[Date with hour],,ASC).

 

I attach another image of how the table is currently and how I need it to look like. I hope you can help me because I can't get it out.

Zapas1428_1-1629372061754.png

How I have

Zapas1428_2-1629372159353.png

How I need

I hope I have explained well a greeting.

 

1 REPLY 1
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Zapas1428 ,

 

Try this out: 

 

RANKmeausre= 
Var currentrnk= MAX(Tabla Resumen Autobox'[Date with hour])

RETURN

RANKX(FILTER(ALLSELECTED(Tabla Resumen Autobox),Tabla Resumen Autobox'[Date with hour]= currentrnk),Tabla Resumen Autobox'[Date with hour],,ASC, Dense)

 

 

 I hope this helps.

 

Mark this as a solution if I answered your question. Kudos are always appreciated.

Thanks.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.