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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HMJSomerset
Helper II
Helper II

Daily Rank Entries from Customers

I have a table where providers submit their capacity each day. Sometimes, if a new slot opens up they complete the form a second time to update their capacity. What I want to do is rank each entry for each provider each day.
e.g
ProviderTimestampCapacityRank
A24/05/2021 10:1811
A24/05/2021 09:1802
B24/05/2021 10:2001
A23/03/2021 10:3011
B23/03/2021 09:2021
 
Daily Rank =
RANKX(
FILTER(
ProvCapacity,
ProvCapacity[ProviderID]=EARLIER(ProvCapacity[ProviderID])
),
ProvCapacity[Timestamp]
)
 
With this formula, I get the correct rank for 24/05/2021 but 23/05/2021 is assigned a rank of 3.
How can I adjust the expression to reset the calculation for each day?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@HMJSomerset , Create a date from from Timestamp

 

Date = [Timestamp].date
or
Date = date(year([Timestamp]),month([Timestamp]),day([Timestamp]))

 

and then try this rank column

Daily Rank =
RANKX(
FILTER(
ProvCapacity,
ProvCapacity[ProviderID]=EARLIER(ProvCapacity[ProviderID]) && ProvCapacity[Date]=EARLIER(ProvCapacity[Date])
),
ProvCapacity[Timestamp]
)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@HMJSomerset , Create a date from from Timestamp

 

Date = [Timestamp].date
or
Date = date(year([Timestamp]),month([Timestamp]),day([Timestamp]))

 

and then try this rank column

Daily Rank =
RANKX(
FILTER(
ProvCapacity,
ProvCapacity[ProviderID]=EARLIER(ProvCapacity[ProviderID]) && ProvCapacity[Date]=EARLIER(ProvCapacity[Date])
),
ProvCapacity[Timestamp]
)

Thank you.  I have amended the DAX and it now works correctly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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