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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply

Format measure to showing ordinary numbers

Hello,

I have very simple measure contains SUM of numbers. The result of this measure is standard number e.g. 1 2,3,4,....59,..... etc.

It is possible to recreate this measure to showing ordinary numbers like 1st, 2nd....21th etc?

Thank you for your help

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lucie_rabochova 

 

Based on your needs, I have created the following table.

vjialongymsft_0-1723702076600.png

 

 

Then you can use the following Dax to get the result you want:

Ordinal Numbers = 
VAR _Last2Number = RIGHT( [Standard number], 2 )
VAR _LastNumber = RIGHT( [Standard number], 1 )
RETURN
    [Standard number]&SWITCH( TRUE( ),
        _Last2Number IN { "11", "12", "13" }, "th",
        _LastNumber = "1", "st",
        _LastNumber = "2", "nd",
        _LastNumber = "3", "rd",
        "th"
    )

 

 

Result:

vjialongymsft_1-1723702390328.png

 

 

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @lucie_rabochova 

 

Based on your needs, I have created the following table.

vjialongymsft_0-1723702076600.png

 

 

Then you can use the following Dax to get the result you want:

Ordinal Numbers = 
VAR _Last2Number = RIGHT( [Standard number], 2 )
VAR _LastNumber = RIGHT( [Standard number], 1 )
RETURN
    [Standard number]&SWITCH( TRUE( ),
        _Last2Number IN { "11", "12", "13" }, "th",
        _LastNumber = "1", "st",
        _LastNumber = "2", "nd",
        _LastNumber = "3", "rd",
        "th"
    )

 

 

Result:

vjialongymsft_1-1723702390328.png

 

 

 

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks a lot, it works perfect!

SachinNandanwar
Super User
Super User

If you mean ordinal numbers then unfortunately there isnt an inbuilt function in DAX.However you can have a look at this article on possible ways on how to achieve it

https://gorilla.bi/power-bi/ordinal-numbers/



Regards,
Sachin
Check out my Blog

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors