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! Learn more

Reply
Anonymous
Not applicable

Help creating new column depending Date column

Hi all,

 

I need to create a new column due to the following scenario:

 
 

Captura.PNG

At the end is to move the cuantities one month less in the Sales Date. I was trying with Lookupvalue but it didn't work.

 

I hope you can help me thanks.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@romero01 , Try

sumx(filter( Table, [Product]-earlier([Product]) && [Customer]-earlier([Customer]) && [StockDate]-earlier([SalesDate] ),[ventas])

O
sumx(filter( Table, [Product]-earlier([Product]) && [Customer]-earlier([Customer]) && [SalesDate]-earlier([StockDate] ),[ventas])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@romero01 , Try

sumx(filter( Table, [Product]-earlier([Product]) && [Customer]-earlier([Customer]) && [StockDate]-earlier([SalesDate] ),[ventas])

O
sumx(filter( Table, [Product]-earlier([Product]) && [Customer]-earlier([Customer]) && [SalesDate]-earlier([StockDate] ),[ventas])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @Greg_Deckler  I was testing the qurey but seems is saying to me that the parameter is not correct type.

 

Hi @amitchandak I think we are close 🙂 but only is showing one result or maybe only is taking the first one. 

 

Captura.PNGAttached the link with the powerbi document. Whith both querys.

https://t2cspain-my.sharepoint.com/:u:/g/personal/cromero_t2client_com/EbH-iRo4w3hPluWNiQR2YYcB2V2uv...

 

I hope yu can help me thanks.

Anonymous
Not applicable

Hi @Anonymous ,

Could you please provide the correct value of field [WhatIWant] base on your current sample data and the calculation logic? Thank you.

Help creating new column depending Date column_2.JPG

Best Regards

Rena

Anonymous
Not applicable

Hi @Greg_Deckler  any tip about this topic?

 

Hi @amitchandak  any tip about this topic?

@Anonymous I had a syntax error, maybe:

What I Want =
  MAXX(
    FILTER(
      'Table',
      [Product]=EARLIER([Product]) &&
        [StockDate]=EARLIER([SalesDate]) &&
          [Customer]=EARLIER([Customer])
    ),
    [Stock]
  )


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...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

What I Want =
  MAXX(FILTER('Table',[Product]=EARLIER([Product])&&[StockDate]=EARLIER([SalesDate]&&[Customer]=EARLIER([Customer])),[Stock])


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

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.

Top Solution Authors