Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Variation real vs. real past year

Hi, I have the following problem.

 

My data look like this (comes from an Excel file):

 

Through DAX y manage to get the value of the same date but from the period of the past year, so far the table on PBI look like this:

 

Now I want to aggregate a column with the variation in percentage but I am having trouble with how to do that.

 

Thanks !!

 

  • MFelix's avatar
    MFelix
    8 years ago
    Hi Anonymous,

    Do.a simple.measure for.dolar

    Dolar = SUM (Longitudinal[Dólar])

    Add to your visial to.replace the current dolar column and the make the measure I indicated in previous post to make the variation.

    Regards,
    MFelix

4 Replies

  • Hi Anonymous,

     

    If the values you present here are two calculated measures you simply have to make something like this:

     

    Variation = Divide( [Dólar] ; [Dolar Ano Ant]) -1

    And then format as a  %, if this values are not measures you need to make them both as measures.

     

    can you share the syntax for both values and of they are measures?

     

    Regards,

    MFelix

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi MFelix

       

      The column of "Dólar" it's the value from the data (the Excel file) meanwhile the column "Dolar Año Ant" it's a calculated measure with the following syntax:

       

      Dolar Año Ant = CALCULATE(SUM(Longitudinal[Dólar]),SAMEPERIODLASTYEAR(Longitudinal[Fecha]))

       

      Thanks !!

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User
        Hi Anonymous,

        Do.a simple.measure for.dolar

        Dolar = SUM (Longitudinal[Dólar])

        Add to your visial to.replace the current dolar column and the make the measure I indicated in previous post to make the variation.

        Regards,
        MFelix