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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.