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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Saes
Helper I
Helper I

Identify Earliest Records

Hi all,

 

I've got a set of tenancy lettings data and I need to categorise a lettings order for each property. For example, the data I have looks like this:

 

Tenancy IDTenancy Start DateProperty IDAddress
TEN00101/04/2005PROP0011 PowerBI Street
TEN00221/06/2007PROP0011 PowerBI Street
TEN00321/10/2007PROP0011 PowerBI Street
TEN00404/08/2017PROP0022 Computer Close
TEN00523/06/2021PROP0022 Computer Close
TEN00625/10/2021PROP0022 Computer Close

 

And I need to add a calculated column that shows this:

 

Tenancy IDTenancy Start DateProperty IDAddressTenancy Letting ID
TEN00101/04/2005PROP0011 PowerBI StreetFirst Let
TEN00221/06/2007PROP0011 PowerBI StreetSecond Let
TEN00321/10/2007PROP0011 PowerBI StreetThird Let
TEN00404/08/2017PROP0022 Computer CloseFirst Let
TEN00523/06/2021PROP0022 Computer CloseSecond Let
TEN00625/10/2021PROP0022 Computer CloseThird Let

 

I've tried several combinations of DAX, but I've not been successful. Can anyone help?

 

Thanks!

 

1 ACCEPTED SOLUTION

Thank you - I had to make a tweak, but it worked. The final formula I've used is here:

Tenancy Letting Order =

    RANKX (
            FILTER (
                ALL ( 'Lettings Data'), [Property ID] = EARLIER ( 'Lettings Data'[Property ID] ) ),
                    'Lettings Data'[Tenancy ID],
                    ,
                    ASC,
                    DENSE
        )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could add a calculated column like

Letting number =
RANKX (
    ALLEXCEPT ( 'Table', 'Table'[Property ID] ),
    'Table'[Tenancy Start Date],
    ASC
)

Thank you - I had to make a tweak, but it worked. The final formula I've used is here:

Tenancy Letting Order =

    RANKX (
            FILTER (
                ALL ( 'Lettings Data'), [Property ID] = EARLIER ( 'Lettings Data'[Property ID] ) ),
                    'Lettings Data'[Tenancy ID],
                    ,
                    ASC,
                    DENSE
        )

Helpful resources

Announcements
60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.