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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to count duplicates within date range as applied through slicers

In a list of DateTime, phone numbers, I need to find out dupes of phone numbers based on user applied filters/slicers against date range.

 

For exmaple, if user selected date range from 1st Jan 2021 to 31st Dec 2021, I need to count dupes of phone numbers with this date range. As and when user change date range, dupes count need to change please.

 

Appreciate your help. Thanks 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create a date field , use that in slicer or join it with date table and use slicer from date table

 

DateTime = datevalue([DateTime])

 

You can have measures

M1= count(Table[Phone Numbers])

 

Duplicate = countx(filter(values(Table[Phone Numbers]) , [M1] >1 ), [Phone Numbers])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Create a calculated column formula to extract Date from the Date/Time column

Date = int(Data[DateTime])

Create a Calendar Table and write calculated column formulas to exteact Year, Month name and Month number.  Sort the Month name by the month number.  To your visual, drag Year and Month name from the Calendar Table and select any one Year and Month name.  Write these measures:

Phone number count = counta(Data[Phone])

Measure 1 = countrows(filter(values(Data[Phone]),[Phone number count]>1))

Hope this helps.


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

Hi @Anonymous 

 

If your data is in the below format

varunsabu_0-1651221575556.png

You can extract the date column in power query as follows(You can achieve this using DAX formula too)

Select Date Time column -> go to Add Column ribbon -> Date -> Date Only

varunsabu_2-1651221805964.png

In Power BI desktop create a measure as follows

varunsabu_3-1651222475368.png

It will return the number of times a phone number is duplicated for the selected date range.

varunsabu_4-1651223242920.png
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Unfortunatly, its showing just a [Total Count of Phone]-1, but I wanted to know number of dupes within slicers applied

amitchandak
Super User
Super User

@Anonymous , You can create a date field , use that in slicer or join it with date table and use slicer from date table

 

DateTime = datevalue([DateTime])

 

You can have measures

M1= count(Table[Phone Numbers])

 

Duplicate = countx(filter(values(Table[Phone Numbers]) , [M1] >1 ), [Phone Numbers])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Unfortunatly, dupes being calculated based on entire dataset. But I wanted dupes within selected date range

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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