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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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