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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ase
Frequent Visitor

Creating a new column which takes values from another column for previous period

Hi all,

 

I have a problem creating a column/measure which takes the value from another column but for the next period. Below is an illustration of the issue:

 

ase_1-1655393543429.png

 

I tried to create a new column which was basically: Month+1 and then use looupvalue of an IF function but without any success. 

 

Basically I need to have for each product (Apple) the inventory in March and the inventory in April on the same line, so they can be used for visuals. 

 

Could you please help me out?

 

Kind regards,

B

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @ase 

Thanks for reaching out to us.

You can try this, create a new column

Column = CALCULATE(MAX('Table'[Inventory]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[Month]=EARLIER('Table'[Month])+1))

vxiaotang_0-1655804300728.png

Or measure,

Measure = CALCULATE(MAX('Table'[Inventory]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[Month]=MIN('Table'[Month])+1))

vxiaotang_1-1655804359276.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @ase 

Thanks for reaching out to us.

You can try this, create a new column

Column = CALCULATE(MAX('Table'[Inventory]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[Month]=EARLIER('Table'[Month])+1))

vxiaotang_0-1655804300728.png

Or measure,

Measure = CALCULATE(MAX('Table'[Inventory]),FILTER(ALLEXCEPT('Table','Table'[Product]),'Table'[Month]=MIN('Table'[Month])+1))

vxiaotang_1-1655804359276.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

ase
Frequent Visitor

This seems too complicated for me. Is there a way to create a simple lookup based on the previous month value?

Greg_Deckler
Community Champion
Community Champion

@ase See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column = 
  VAR __Current = [Value]
  VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])

  VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
  __Current - __Previous



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...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.