Forum Discussion
jmcconville
7 years agoFrequent Visitor
Convert Decimals to Custom Fractions
I need the summarized values (on charts and tables) to show as a custom fraction. My organization counts contracts in 13 week incriments. IE 1 contract = 13 weeks. If a contract is less or more than ...
- 7 years ago
Hi jmcconville
you can alsways add it like this:
Column = VAR _decimal = 13 VAR _Remainder = MOD( [ContractsMeasure], 1 ) RETURN IF( _Remainder = 0, "" & [ContractsMeasure], [ContractsMeasure] & " " & ROUND( _Remainder * _decimal, 0) & "/" & _decimal )
LivioLanzo
7 years agoSolution Sage
Hi jmcconville
the FORMAT function in DAX is based on the format strings used by Visual Basic.
try this format string:
FORMAT( 1893.15, "# .#/13")
jmcconville
7 years agoFrequent Visitor
Hi
LivioLanzo . Thank you for your response
I've done the format you suggested and it's still not showing correctly. Here's what Power BI is showing
Here is what the correct calculation in excel is showing
Example: 755.38 = 755 5/13
the remainder (.38) divided by 13 is 5/13. Power BI is showing this as 4/13
let me know your thoughts! thanks
- LivioLanzo7 years agoSolution Sage
Hi jmcconville
you can alsways add it like this:
Column = VAR _decimal = 13 VAR _Remainder = MOD( [ContractsMeasure], 1 ) RETURN IF( _Remainder = 0, "" & [ContractsMeasure], [ContractsMeasure] & " " & ROUND( _Remainder * _decimal, 0) & "/" & _decimal )