cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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.

pbi2.png

5 REPLIES 5
Highlighted
Super User V
Super User V

Re: Compare values between rows of custom data

Hi,

 

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Regular Visitor

Re: Compare values between rows of custom data

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.

Untitled.png

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
Highlighted
Frequent Visitor

Re: Compare values between rows of custom data

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

Highlighted
Frequent Visitor

Re: Compare values between rows of custom data

Highlighted
Super User V
Super User V

Re: Compare values between rows of custom data

Hi,

 

You may refer to my solution here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors