The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
Based on your needs, I have created the following table.
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:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Based on your needs, I have created the following table.
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:
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!
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/
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |