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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nok
Advocate II
Advocate II

New column that calculates values ​​based on the last month of December

Hello!
I have a table that follows this structure:

idmonthmonthly price
111  01/12/2023   3528,58
11101/01/20243659,41
11101/02/20244866,62
11101/03/20246650,90
22201/12/20231000,10
22201/01/20242000,20
22201/02/20243000,30

 

I want to create a new column that does the following calculation, by each different id:
(((monthly price / last December's monthly price) -1) *100) + 100

 

The expected result would be something like this:

idmonthmonthly price   new column
111   01/12/2023   3528,58(value based on December 2022) 
11101/01/20243659,41103,7077
11101/02/20244866,62137,9201
11101/03/20246650,90188,4866
22201/12/20231000,10(value based on December 2022)
22201/01/20242000,20200
22201/02/20243000,30300


How can I make this new column?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@nok See PBIX attached below signature.

Column = 
    VAR __Min = MIN( 'Table'[month] )
    VAR __id = [id]
    VAR __LastDecember = DATE( YEAR( [month] ) - 1, 12, 1 )
    VAR __LastDecValue = MAXX( FILTER( 'Table', [id] = __id && [month] = __LastDecember ), [monthly price] )
    VAR __Result = IF( [month] = __Min, BLANK(), ( ( ( [monthly price] / __LastDecValue ) - 1 ) * 100 ) + 100 )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@nok See PBIX attached below signature.

Column = 
    VAR __Min = MIN( 'Table'[month] )
    VAR __id = [id]
    VAR __LastDecember = DATE( YEAR( [month] ) - 1, 12, 1 )
    VAR __LastDecValue = MAXX( FILTER( 'Table', [id] = __id && [month] = __LastDecember ), [monthly price] )
    VAR __Result = IF( [month] = __Min, BLANK(), ( ( ( [monthly price] / __LastDecValue ) - 1 ) * 100 ) + 100 )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Amazing!!
Thanks for the great solution, @Greg_Deckler 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors