Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Add "%" to Calculation items in Calculation groups.

I am having trouble with two things:   1. I have a time intellegence calculation item called YoY%. I am getting the value, however I ran into a problem when I included the % symbol against each ret...
  • VahidDM's avatar
    4 years ago

    Hi Anonymous 

     

    Change the measure format:
    1 - you can add format to the DAX code:

     

     

     

    VAR CY =
        SELECTEDMEASURE ()
    VAR PY =
        CALCULATE ( SELECTEDMEASURE (), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
    VAR YOY = CY - PY
    RETURN
        FORMAT ( DIVIDE ( YOY, PY ), "Percent" )

     

     

     

     

    2 - Change the Measure format:

     

     

     

    VAR CY =
        SELECTEDMEASURE ()
    VAR PY =
        CALCULATE ( SELECTEDMEASURE (), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
    VAR YOY = CY - PY
    RETURN
        DIVIDE ( YOY, PY )

     

     

     

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/