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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.