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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sv98917n
Helper I
Helper I

Duplicate Filter That Works With Date Slicer

Hello,

 

I currently have this column that shows how many times an id number appears:

 

Count Duplicates =
Var SegmentID = [SEGMENT_ID]
RETURN

CALCULATE(
COUNTROWS('table'),
all('Table'),
'Table'[SEGMENT_ID] = SegmentID
)
 
 

While this flag works for the whole report, it does not show values in accordance with my [created_date] date slicer. Yes, I do have a page level filter, but it does not change the DAX responces. So when I select a date range based on the created date, it says "3" or "2" to values that are duplictaes for the whole report range, but not the sliced range. 

 

Any help would be greatly appreciated.  Thank you!! 

 
1 ACCEPTED SOLUTION

He was able to work with this formula:

(COUNTROWS (FILTER (allselected (table), table [SEGMENT_ID] at max (table [SEGMENT_ID])))
Thank you for your help!

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@sv98917n , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Not able to get with queries, what exactly it is doing

He was able to work with this formula:

(COUNTROWS (FILTER (allselected (table), table [SEGMENT_ID] at max (table [SEGMENT_ID])))
Thank you for your help!

Hi @sv98917n ,

 

Glad that you have resolved it. Can you please accept your answer as solution? Others will benefit from it. Thanks!

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

By any chance, does this work?

Count Duplicates =
Var SegmentID = [SEGMENT_ID]
RETURN
CALCULATE(COUNTROWS('FULCRUM_311_SRVREQ_NRT'),'Table'[SEGMENT_ID] = SegmentID)
Also, you must create a Calendar Table and build a relationship from the Date column of the base Table.  To your visual, drag dates from the Calendar Table.
If this does not help, then share some data in a format that can be pasted in an MS Excel workbook and clearly show the expected result there.

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

Count Duplicates =
Var SegmentID = [SEGMENT_ID]
RETURN

 

CALCULATE(
COUNTROWS('Table'),
all('Table'),
'Table'[SEGMENT_ID] = SegmentID
)
 
 
this is my original formula. It was written wrong. Everything is coming from the same table. Thank you. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.