Forum Discussion

NewbieJono's avatar
NewbieJono
Icon for Post Partisan rankPost Partisan
1 year ago
Solved

Ratio Calculation Rounding

Hello, is there any way to Round down the second part of this ratio Calc

 

Ratio =
VAR RATIO =
    DIVIDE (
        SUM ( 'FACT - Data'[final_unique_count] ),
        SUM ( 'FACT - Volumes'[Volume] )
    )
RETURN
    CONCATENATE ( "1", CONCATENATE ( " : ", Ratio ) )
 
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi NewbieJono 

     

    Thanks for the reply from PhilipTreacy .

     

    You can also try using ROUND. The following test is for your reference:

     

    Sample:

     

    Create a measure as follows

    Radio = 
    VAR _radio = SUM('FACT - Volumes'[Volume])
    RETURN
    CONCATENATE("1", CONCATENATE(":", ROUND(_radio, 10)))

     

    In your scenario you can directly change the formula:

    Ratio =
    VAR RATIO =
        DIVIDE (
            SUM ( 'FACT - Data'[final_unique_count] ),
            SUM ( 'FACT - Volumes'[Volume] )
        )
    RETURN
        CONCATENATE ( "1", CONCATENATE ( " : ", ROUND(RATIO, "Specify the number of digits to round off") ) )

     

    Output:

     

    For more details about the ROUND function, you can read related document link:

    ROUND function (DAX) - DAX | Microsoft Learn

     

    Best Regards,
    Yulia Xu

     

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi NewbieJono 

     

    Thanks for the reply from PhilipTreacy .

     

    You can also try using ROUND. The following test is for your reference:

     

    Sample:

     

    Create a measure as follows

    Radio = 
    VAR _radio = SUM('FACT - Volumes'[Volume])
    RETURN
    CONCATENATE("1", CONCATENATE(":", ROUND(_radio, 10)))

     

    In your scenario you can directly change the formula:

    Ratio =
    VAR RATIO =
        DIVIDE (
            SUM ( 'FACT - Data'[final_unique_count] ),
            SUM ( 'FACT - Volumes'[Volume] )
        )
    RETURN
        CONCATENATE ( "1", CONCATENATE ( " : ", ROUND(RATIO, "Specify the number of digits to round off") ) )

     

    Output:

     

    For more details about the ROUND function, you can read related document link:

    ROUND function (DAX) - DAX | Microsoft Learn

     

    Best Regards,
    Yulia Xu

     

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