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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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