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

Year on Year Change in Population

I have Country, Year and Total Population Measure in the population Table,

I want to know the difference of Population Year on Year in figures as well as in percentage)

 

Year Pop.JPG


I have tried mention below attempts.

Created the 
(mention below date year is into the different table where i have connected it with population) the formula doesnt give any error but when 

Attempt #1 
PrevisouYear Pop = [Total Population] - PREVIOUSYEAR('Date'[Year])

Capture1.JPG
 
Attempt # 2 
Same Period Last Year pop = CALCULATE(SUM(Populat[Population]) - CALCULATE(SUM(Populat[Population]),SAMEPERIODLASTYEAR('Date'[Year])))
 
Capture1.JPG
 
Attempt #3
 
Created 1st Measure  
TotalPopulationLY = CALCULATE([Total Population], SAMEPERIODLASTYEAR('Date'[Year]))
Created 2nd Measure
Diff B/w LYPop = IF(ISBLANK([TotalPopulationLY]), BLANK(), [Total Population] - [TotalPopulationLY])
 
Dragged the Diff B/w LYPop and still shows me the same error 
 
regards,
Muhammad
 
1 ACCEPTED SOLUTION

Accepted Solutions
MoOv Regular Visitor
Regular Visitor

Re: Year on Year Change in Population

Hello Muhammad,

 

SAMEPERIODLASTYEAR requires a column containing dates. Your 'Date'[Year] column does probably not contain date values. Try using 'Date'[Date] (if possible) instead.

 

Regards,

Moritz

View solution in original post

4 REPLIES 4
MoOv Regular Visitor
Regular Visitor

Re: Year on Year Change in Population

Hello Muhammad,

 

SAMEPERIODLASTYEAR requires a column containing dates. Your 'Date'[Year] column does probably not contain date values. Try using 'Date'[Date] (if possible) instead.

 

Regards,

Moritz

View solution in original post

mohammedkhan Regular Visitor
Regular Visitor

Re: Year on Year Change in Population

Wow, this worked, thank you Moov 

mohammedkhan Regular Visitor
Regular Visitor

Re: Year on Year Change in Population

How should i get the difference for each year? @MoOv 

Highlighted
MoOv Regular Visitor
Regular Visitor

Re: Year on Year Change in Population

I am not sure what you mean. If you drag the measure into the visual, does it not display the correct difference for each year? 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 159 members 1,495 guests
Please welcome our newest community members: