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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.