Forum Discussion
Zorgonaute84
5 years agoRegular Visitor
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...
- 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)returnCALCULATE(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))
Zorgonaute84
5 years agoRegular Visitor
Thanks for your very quick response. The problem, I already tried to convert it into date, but it failed. The format of the [Date Month Year] look not standard. (and in French...)
Zorgonaute84
5 years agoRegular Visitor
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))