Forum Discussion
William_Moreno
Helper II
6 years agoReturn null in a specific condition
Hello people, I need help from the experts powerbi. I have the following spreadsheet, formed by the fields: ID_PRODUCT, SALES_MONTH, QTY. From this, I want to create two new columns: FIRST SALE ...
- 6 years ago
William_Moreno - First will be:
First = MINX(FILTER('Table (27)',[ID PRODUCT]=EARLIER([ID PRODUCT]) && [SALES_MONTH]>=EARLIER([SALES_MONTH]) && [QTY]<>0),[SALES_MONTH])Reviewed
Reviewed = IF([SALES_MONTH]<[First] && [QTY]=0,BLANK(),[QTY])PBIX attached.
amitchandak
Super User
6 years ago
First Sales = minx(filter(Retail, Retail[SALES_MONTH]=EARLIER(Retail[PRODUCT])),Retail[SALES_MONTH])
I did not second, How can we have something before first sales?
William_Moreno
Helper II
6 years agoYes, you're right but, when this field is zero not null, the average is changed. Imagine if we were talking about a new product, month before that first sale it can not influence the average, Do you agree?
Anyway thank you for your post.