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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
admin11
Memorable Member
Memorable Member

How to create expression for detect new product ?

Hi All

 

I got 2 fields.

- Last Sales

- Last Purchase Date

 

May i know how to write the expression , when :-

 

Last Sales = 00/00/0000 & Last Purchase Date not = 00/00/0000 is equal to new product

 

Hope some one can share with me.

 

Paul

 

 

 

1 ACCEPTED SOLUTION

Hi,

This calculated column formula works

New Product_final 1 = IF(and(INVC[Last Sales]=blank(),invc[Last Purchase Date]<>blank()),"New product","Existing product")

Hope this helps.

Untitled.jpg


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

12 REPLIES 12
VahidDM
Super User
Super User

Hi @admin11 

 

Try this:

 

Measure= if(MAX([Last Sales])<>MAX([Last Purchase Date]),"new product")

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

 

Appreciate your Kudos!!




@VahidDM 

Thank you for sharing . i have try your propose code , it display Blank . Actual my condition , There is no sales for new product , Last Sales is 00/00/0000 , But There is Purchase date. As i indicate in Red below. 

 

Last Sales = 00/00/0000 & Last Purchase Date not = 00/00/0000 is equal to new product

Hi @admin11 

 

Can you share a sample of your data in the table format?

 

Appreciate your Kudos!!

 

@VahidDM

 

Here you go.

 

admin11_0-1636243054444.png

 

Hi,

Try this measure

=countrows(filter(values(Data[Model_invc]),[last sales]=blank()&&[last purchase date]<>blank()))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

I still get error after modify your script.
new_pro = countrows(filter(values(data[INVC][Last Salesl=blank()&&[Purchase date]<>blank())))
 

Hi,

This calculated column formula works

New Product_final 1 = IF(and(INVC[Last Sales]=blank(),invc[Last Purchase Date]<>blank()),"New product","Existing product")

Hope this helps.

Untitled.jpg


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

Many thank , your script working fine.

Paul

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@admin11 
Try this measure:

Measure = IF(
    ISBLANK( MAX( [Last Sales] ) ) && NOT ISBLANK( MAX( [Last Purchase Date] ) ),
    "New Product",
    MAX( [Last Sales] )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

@VahidDM 

 

I have try using column , it got error , when i try as measure , it does not able filter.

 

My PBI file :-

https://www.dropbox.com/s/x3w1smk5p2atfxm/PBT_V2021_118.pbix?dl=0

 

Paul

Hi @admin11 

 

Download file: https://gofile.io/d/oXT2Zu

 

Try this measure:

 

New Product =
if(max(INVC[Last Sales])=blank()&&max(INVC[Last Purchase Date])<>blank(),"New Product",max(INVC[Last Sales]))
 
output:
VahidDM_0-1636246442718.png

 

 
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!


 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors