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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

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.