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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
xxx_holic_xxx
Frequent Visitor

Check for duplicate values within 2 months from the data entry system

Check for duplicate values within 2 months from the date the data is entered into the system. 
I want to check for duplicate values with the following rule: if date is 1/1/2019 (d/m/y) => "No", 1/3/2019 => "Yes", 2/3/2019 => "No", 1/4/2019 => "Yes". In short, check the duplicate before 59 days (about 2 months) from the current date. In excel, I use this formula IF(COUNTIFS($A$2:A2,">="&(A3-59),$B$2:B2,[@Number],$C$2:C2,"No")>0, "Yes","No") but I can't figure it out in Power BI or SQL. I look forward to receiving the solutions from all of you. Many thanks.

xxx_holic_xxx_0-1663296419916.png

 

6 REPLIES 6
xxx_holic_xxx
Frequent Visitor

It's an error. I took a screenshot of the excel cell's formula. Its value is "Yes."

xxx_holic_xxx_0-1663553148319.png

 

2019-03-02 says "No"

lbendlin
Super User
Super User

Please explain what you mean by "duplicate numbers".  Why would 2019-03-02 be a No ?

Data is considered "New" labeled "No" because it has been more than 2 months (59 days) after the day it was entered into the system (2019/01/01).

It feels like your sample data is missing an important column. Please clarify.

No, the column and data are sufficient. I can solve it in Excel using the aforementioned formula, but I'm at a loss in Power BI and SQL.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.