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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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])

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])

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.

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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]
  )

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@Anonymous Maybe:

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

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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