Forum Discussion

Zorgonaute84's avatar
Zorgonaute84
Regular Visitor
5 years ago
Solved

Issues with Lookupvalue and EDATE return blank

Hello,   I'm wrting here because I spent a lot hours to solve my problem and I give up... It's 2AM, and I'm so tired 🙂   I'm looking to compare sales between the current month and the previous o...
  • Zorgonaute84's avatar
    Zorgonaute84
    5 years ago

    I succeed !!!

     

    I can't convert into to date in PowerBI, but I did it into power query.

    Then I used my original code (very similar to your except you  miss the article filter)

     

    Sales Last 24 Mths (n-1) =
    var Article = 'Sales and Warranty'[Ref.Article]
    var DatePreviousMonth = EDATE('Sales and Warranty'[Date Month Year],-1)
    return
    CALCULATE(
    SUM('Sales and Warranty'[Sales Last 24 Mths]),
    FILTER('Sales and Warranty',
    'Sales and Warranty'[Date Month Year] = DatePreviousMonth && 'Sales and Warranty'[Ref.Article]=Article))