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
bcobrien77
Helper I
Helper I

same period last year column

Hi,

 

I am struggling with when to use measures vs calculated columns.

 

I have 60K records of data where I am trying to calculate the change in rents (year over year ).

I have easily created measures to do this but I need to categorize these changes into

 

1) Rent Increase, Decrease or no change

2) Stratify the increases/decreases by 100 increments (0-100, 101-200)

 

When I try to create a column to calculate the same period last year I get a circular depdendcy errror. 

What I want to know is if this is how I should be doing this type of calculation and if not what a good approach would be in Power BI.

Thanks in advance. 

3 REPLIES 3
Anonymous
Not applicable

@bcobrien77 

 

Hi,

 

I am trying to do something very similar to what you're doing, which is materializing the result of a measure into a column to be able to stratify/bucketize the values.  Did you ever find a solution to yours?

 

 

Regards,

 

Ferdinand

v-yulgu-msft
Employee
Employee

Hi @bcobrien77,

 

With current information, I cannot imagine your table structure. Please provide some sample data and show us your desired output with simple example so that I can test for you. Also, you can show the measure formula you have created. 

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

The data is structured like this

 

CustomerYearRents
12012100
22012105
42013165
52013170
12014200

The output would look like this

 

 

 2012 to 20132013-20142014-2015
CustomerYear 1 ChangesYear 2 ChangesYear 3 Changes
Rent DecreasesCount of customers with Rent Decreases  
Rent IncreasesCount of customers with Increases  
No Change In Rent   
    
    
Rent Increases   
<25Count of customers with Increases <25  
25 to 50Count of customers with Increases 25 to 50  
50 to 100Count of customers with Increases 50 to 100  
100 to 200Count of customers with Increases 100 to 200  
>200Count of customers with Increases >200  

 

One other thing to keep in mind is that not every customer exists in every year but the concepts would stay the same.

 

Measures Created

Yearly Rents = sum(DATA_FOR_POWER_BI_CSV[Rent_Total])

Total Rents Prior Year = CALCULATE([Yearly Rents],SAMEPERIODLASTYEAR(DATA_FOR_POWER_BI_CSV[Fiscal Year]))

Year Over Year Rent Difference = if(ISBLANK([Total Rents Prior Year]),0 ,[Yearly Rents]-[Total Rents Prior Year])

 

Thanks so much!

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.