Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Songbird
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
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

VCQ
Frequent Visitor

Ashish_Mathur
Super User
Super User

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/

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

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.