Forum Discussion

Songbird's avatar
Songbird
Regular Visitor
8 years ago

Compare values between rows of custom data

Hi I'm new to Power BI.

Why does 

#"Added Index"{[Index]-12}[Total]

work only if [Total] is not an added/custom column?

How do I get this to work on custom culumns?  I'm trying to compare historical data to current.  The data I'm comparing is partially conditional and partially calculated into it's own custom column in the Query Editor.  I realize the first 12 rows will show an error due to a negative index, but everything is getting an error.  This does not happen if the data is original source data.

5 Replies

  • Hi,

     

    Please explain the business question.  Also, what result are you expecting?

    • Songbird's avatar
      Songbird
      Regular Visitor

      In the end I want a visuaization of the current amounts (posts on specific webpages) and the total from the same month in the previous year. That way we can easily compare to how well we did in the previous year.  I can't figure out how to get the "Quick Measure" for YoY to work.

      My data is the first 4 columns, I calculate the total, then I would like to just shift the total down 12 lines.  I don't know if this is the appropreate method.  It seems like it should be simple.

       DatePage1Page2Page3TotalYoY Total
      10/1/201512724121272 
      11/1/2015159126150 
      12/1/20152820125173 
      1/1/2016213101116 
      2/1/201651109115 
      3/1/2016514144163 
      4/1/20161710106133 
      5/1/2016511113129 
      6/1/2016127121140 
      7/1/201645124133 
      8/1/201638127138 
      9/1/2016313105121 
      10/1/2016213089140272
      11/1/20160127991150
      12/1/20161128699173
      1/1/201722486112116
      2/1/201721394109115
      3/1/2017329120161163
      4/1/20173615124175133
      5/1/2017672173161129
      6/1/20175834167259140
      7/1/2017411285138133
      8/1/20171341151205138
      9/1/2017231891132121
      10/1/20171112117140140
      11/1/201751310412291
      12/1/2017889310999
      1/1/20181310118141112
      2/1/2018154114133109
      3/1/20181815121154161
  • VCQ's avatar
    VCQ
    Frequent Visitor

    You can create a measure that is equal to the sum of your three columns. 

     

    Then you can create a measure that is equal to the sum of your three columns from the same period last year using

     

    Calculate(yourmeasure, sameperiodlastyear(date))

     

     

    https://msdn.microsoft.com/en-us/library/ee634972.aspx     <----Sameperiodlastyear documentaiton