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
cottrera
Post Prodigy
Post Prodigy

Find Duplicate Count

Hi

 

I have a table containing date and a count of these dates.  I require an IF statement DAX formula to display 'Yes' if the count  on a particular date, matches the count of the previous date.

 

Table A
DateCountaDuplicate Count
01/10/2019150No
02/10/2019100Yes
03/10/2019100No
04/10/2019340No
05/10/2019374No
06/10/2019400Yes
07/10/2019400No
08/10/2019362No
09/10/2019212No
10/10/201913No
11/10/2019462No
12/10/2019320Yes
13/10/2019320Yes
14/10/2019320Yes
15/10/201913No
16/10/2019362No
17/10/2019100No

 

thank you

RIchard

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi cottera,

Did you want to show bold one as 0? If so, you could try below measure 

Measure =
IF (
    SUM ( a1[Count] )
        = CALCULATE (
            MIN ( a1[Count] ),
            FILTER ( ALL ( a1 ), a1[DateADDED] = MIN ( a1[DateADDED] ) - 1 )
        ),
    0,
    1
)

Best Regards,
Zoe Zhi

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@cottrera 

 

Maybe you can use this 

Measure = IF(
          CALCULATE(
                 COUNTA(Table1[ID]),
                 FILTER(Table1, Table1[ID] = MAX(Table1[ID]))
           )>1, 
           0,
           1
     )

 Stactoverflow solution

 

May the "BI" force be with you!!! If this post helps, then please consider Accept it as the solution to help the other members find it more quickly! Thanks!

Hi thanks for you quick response. Im sure its nearly there but not quite. I have attached the results I am getting. The ones in bold are the ones I would expect a positive result for

 

thanks

 

 

DateADDEDCountMeasures
30/10/2019 07:3358961
29/10/2019 07:3259191
28/10/2019 07:3359190
27/10/2019 07:3359191
26/10/2019 07:2359591
25/10/2019 07:2260001
24/10/2019 07:3361261
23/10/2019 07:2361671
22/10/2019 07:3261381
21/10/2019 07:4261381
20/10/2019 07:3261571
19/10/2019 07:3262301
18/10/2019 07:3262501
17/10/2019 11:2062901
16/10/2019 09:5262981
15/10/2019 07:5262501
14/10/2019 07:2262501
13/10/2019 07:3262521
12/10/2019 08:3362931
11/10/2019 07:4263171
10/10/2019 07:2363801
09/10/2019 07:5364041
08/10/2019 07:4363581
07/10/2019 08:0363601
06/10/2019 07:4363611
05/10/2019 07:5363961
04/10/2019 07:5363551
03/10/2019 08:2364001
02/10/2019 07:2264431
01/10/2019 07:3363941
30/09/2019 07:5363941
29/09/2019 07:4363941
28/09/2019 07:4364921
27/09/2019 07:5365191
26/09/2019 07:5364851
25/09/2019 07:5364481
24/09/2019 07:4364481
23/09/2019 07:2364481
22/09/2019 07:3264491
21/09/2019 07:3365301
20/09/2019 07:3366221
19/09/2019 07:3266771
18/09/2019 09:2258341
17/09/2019 08:4258421
16/09/2019 08:4258421
15/09/2019 08:4258431
14/09/2019 08:4258771
13/09/2019 08:4259161
12/09/2019 08:4259611
11/09/2019 08:4160011
10/09/2019 08:4159751
09/09/2019 08:4259751
08/09/2019 08:4259751
07/09/2019 08:4260121
06/09/2019 08:4260531
05/09/2019 08:4260891
04/09/2019 08:4261541
03/09/2019 08:4261041
02/09/2019 08:4161041
01/09/2019 08:4261041
31/08/2019 08:4161371
30/08/2019 08:4261841
29/08/2019 08:4262771
28/08/2019 08:4262961
27/08/2019 08:4262961
26/08/2019 08:4162961
25/08/2019 08:4262971
24/08/2019 08:4263451
23/08/2019 08:4264311
22/08/2019 08:4264711
21/08/2019 08:4265481
20/08/2019 08:4265541
19/08/2019 08:4265541
18/08/2019 08:4265561
17/08/2019 08:4265841
16/08/2019 08:4166601
15/08/2019 08:4267661
14/08/2019 08:4269131
13/08/2019 08:4269391
12/08/2019 08:4269391
11/08/2019 08:4269521
10/08/2019 08:4269371
09/08/2019 08:4269691
08/08/2019 08:4570701
07/08/2019 11:4170701
dax
Community Support
Community Support

Hi cottera,

Did you want to show bold one as 0? If so, you could try below measure 

Measure =
IF (
    SUM ( a1[Count] )
        = CALCULATE (
            MIN ( a1[Count] ),
            FILTER ( ALL ( a1 ), a1[DateADDED] = MIN ( a1[DateADDED] ) - 1 )
        ),
    0,
    1
)

Best Regards,
Zoe Zhi

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

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.

Top Solution Authors