Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Increase % between two years

Hello,
I'm new in this world of Power BI and I need some help.
I've been trying to get the increase percentage of sales between 2 years. The sales are in the same column and there's a time dimension table where it contains the year.

Thanks for your help!!!

 

Relationships:

 

 

 

Matrix Result:

 

 

Thaaanks!!!

  • Vvelarde's avatar
    Vvelarde
    9 years ago

    Anonymous

     

    I recreate your tables in a reduce version:

     

    Relationships

     

    And Dax and Results

     

    Dax and Results

     

    You can try to modify Salesof1YearBefore :

     

    Salesof1YearBefore = Calculate([Sales],DATEADD(public_dim_tiempo[Date],-1,YEAR))

8 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    Hi Anonymous

     

    Try with these measures and let me know:

     

    Sales=Calculate(sum(public hec_ventas_ejecu[soles_vv]))

     

    Salesof1YearBefore =Calculate([Sales],Sameperiodlastyear(public_dim_tiempo[Fecha]))

     

    %IncreaseYoY=[Sales]/[Salesof1YearBefore]-1

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Vvelarde :)

      I did what you explained, and the result between 2016 and 2015 was 0.00% ... in the matrix, when I included the measures: Sales=Calculate(sum(public hec_ventas_ejecu[soles_vv])) and Salesof1YearBefore =Calculate([Sales],Sameperiodlastyear(public_dim_tiempo[Fecha])), I got the same amount of sales per each city.

       

      Please, if you can help me, I'll be very thankful.

       

      Thanks!

       

      • Vvelarde's avatar
        Vvelarde
        Community Champion

        Anonymous

         

        I recreate your tables in a reduce version:

         

        Relationships

         

        And Dax and Results

         

        Dax and Results

         

        You can try to modify Salesof1YearBefore :

         

        Salesof1YearBefore = Calculate([Sales],DATEADD(public_dim_tiempo[Date],-1,YEAR))

  • mitsu's avatar
    mitsu
    Resolver IV

    One of the ways that you can try to aceive this is as follows . 

     

    Create a Prior Year Sales Claculation  as

     

     CALCULATE(SUM([Sales]),SAMEPERIODLASTYEAR('Date'[Date]))

     

     

    The percent inclrease can then be calculated as [Prior Year Sales]-[Sales]/[Sales]

     

     

    Please make sure your date dimension is marked as a date table . 

     

     

    Hope this helps !!

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Mitsu,

      Thanks for your help, but your solution doesn't work :(

      • v-micsh-msft's avatar
        v-micsh-msft
        Microsoft Employee

        Hi andrea9gutiampu,

         

        What is your current situation?

        Regarding Matrix, there is no way to remove the first column you marked in the visual. The values shows in that column is for the increase Precent, currently there is no customization available to hide the values that shows no input. For the Totals, we could disable it under the Format pane.

        Format->General->Total Column

        For the same amount per each city, this could be cuased by that the sales calculated is not associated with the city column(I mean they are not under the same table), or there might be issues regarding the relationships between those tables.

        Post back if you need any further assistance.

        Regards