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

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

Reply
ase
Frequent Visitor

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

Hi all,

 

I still 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_0-1655794783966.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 with a simple Dax to overcome this issue?

 

Kind regards,

B

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @ase 
Assumening the Month column is a sequential number then you may try

New Inventory Column =
VAR CurrentMonth = TableName[Month]
VAR CurrentProductTable =
    CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Product] ) )
VAR NextMonthTable =
    FILTER ( CurrentProductTable, TableName[Month] = CurrentMonth + 1 )
RETURN
    MAXX ( NextMonthTable, TableName[Inventory] )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @ase 
Assumening the Month column is a sequential number then you may try

New Inventory Column =
VAR CurrentMonth = TableName[Month]
VAR CurrentProductTable =
    CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Product] ) )
VAR NextMonthTable =
    FILTER ( CurrentProductTable, TableName[Month] = CurrentMonth + 1 )
RETURN
    MAXX ( NextMonthTable, TableName[Inventory] )
ase
Frequent Visitor

It worked! Thank you so much for the straight-forward and easy to follow solution! 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.