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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

New Column Change by Year

Hi All,

 

I have sucessfully create a measure that calculate year by year change. However, due to peculiiarities of the data i believe I need to create a column with the numbers. I have no idea how to do it to be honest, any help will be greatly appreciatted. There are many other years in the data, asshown in the Year 2010, Occupation D is new threfore it must be 100%. Thanks Again.

 

Year                  Occupation                  Number                 GROWTH

2010                      A                                         10                                 100%

2010                      B                                         10                                  100%

2010                      C                                         9                                       50%

2010                      D                                          5                                    100% ( not in the previous period therefore must be 100%)

 

2009                     A                                           5                                   

2009                     B                                           5

2009                    C                                            6

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 
First calculate previous year's number

 
Previous Number = 
CALCULATE (
    MAX ( 'Table1'[Number] ),
    FILTER (
        'Table1',
        YEAR ( 'Table1'[Year] )
            = YEAR ( EARLIER ( 'Table1'[Year] ) ) - 1
            && [Occuption] = EARLIER ( Table1[Occuption] )
    )
)

Then calculate growth

Growth = IF(DIVIDE(Table1[Number],Table1[Previous Number], 1) = 1,
1,
DIVIDE(Table1[Number],Table1[Previous Number], 1) - 1)

2019-04-08 15_34_37-Window.png

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 
First calculate previous year's number

 
Previous Number = 
CALCULATE (
    MAX ( 'Table1'[Number] ),
    FILTER (
        'Table1',
        YEAR ( 'Table1'[Year] )
            = YEAR ( EARLIER ( 'Table1'[Year] ) ) - 1
            && [Occuption] = EARLIER ( Table1[Occuption] )
    )
)

Then calculate growth

Growth = IF(DIVIDE(Table1[Number],Table1[Previous Number], 1) = 1,
1,
DIVIDE(Table1[Number],Table1[Previous Number], 1) - 1)

2019-04-08 15_34_37-Window.png

 
Anonymous
Not applicable

Hi Aclerk,

 

Thanks for providing an answer.

 

Is you response formula to built a measure or a new column?

 

Thanks,

 

Ian

Anonymous
Not applicable

Hi,

I have used 2 new columns in my solution.

Ta!

Ashish_Mathur
Super User
Super User

Hi,

Modify your measure to

=IFERROR(your_measure,1)

Hope this helps.


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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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