This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
How to show a number in a "New Measure" as a Fraction or Ratio?
Solved! Go to Solution.
The general algorithm would be for the example that you've given.
Given : 2.5
1. Represent the number as a fraction : 25/10
2. Find GCD(25,10) = 5
3. Divide both the numerator and denominator by GCD=5
Result: 5/2
It's up to you to choose the precision. Here is my take on some DAX
Fraction =
var given=2.5
var precision=100000
return (given*precision/GCD(given*precision,precision))&"/"&(precision/GCD(given*precision,precision))
The general algorithm would be for the example that you've given.
Given : 2.5
1. Represent the number as a fraction : 25/10
2. Find GCD(25,10) = 5
3. Divide both the numerator and denominator by GCD=5
Result: 5/2
It's up to you to choose the precision. Here is my take on some DAX
Fraction =
var given=2.5
var precision=100000
return (given*precision/GCD(given*precision,precision))&"/"&(precision/GCD(given*precision,precision))
Hi there, I have been using this DAX measure and it is working perfectly but I am getting a number like this for a value that should be 15/26.
Also, I would like it to say, for example 2/2 or 5/5 instead of 1/1 in the case of a whole number. How do I do this?
Thanks so much in advance.
What do you mean exactly ?
You can use the symbol "/" or, even better, the DAX function Divide in your measures.
You can then display the measure as percentage in 'Modeling' > Formatting.
Currently I am using it as
Measure = format(2.5,"0.0%")
Which will display it as 250.0% but I want it to display it as 5 / 2 or 5 : 2.
Hi @arpitkumar2310,
As there is no option to set number format for a measure to Fraction in 'Modeling' > Formatting currently, I would suggest you to submit your requirement on Power BI Ideas and vote it up to improve Power BI on this feature.![]()
Regards
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 61 | |
| 36 | |
| 29 | |
| 22 | |
| 21 |