Identifying Duplicates DAX forumla not working as intended

slow1911s

New Member
Joined
May 12, 2012
Messages
6
This is the formula I'm using in a calculated column:

=IF(
CALCULATE(COUNTROWS(Table1),
FILTER(Table1,
Table1[Column1]=EARLIER(Table1[Column1]) &&
Table1[Column2]=EARLIER(Table1[Column2])
)
)>1,0,1
)

Column1
Column2
CalculatedColumn
Billy
Yes
1
Billy
Yes
1
Billy
Yes
1
Billy
Yes
1

<tbody>
</tbody>

This isn't what expect. I expect that this would put a 0 in cells 2-4 in the calculated column. If I was using basic Excel formulas it would look like this: =IF(SUMPRODUCT($A2:A2=A2)*($B2:B2=B2))>1,0,1)

I also tried EARLIEST to see if that changed things - no. I'm just trying to find unique instances of various combinations of data.

Thanks in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi!

You might want to take a look at defining a unique ID per row otherwise there's no other way that Powerpivot can tell under what context what row comes first. It'll throw you something like the count of total times that the combination appears with something like this:
Code:
=COUNTAX( FILTER( Table, 
            EARLIER([Column1])=[Column1] && 
              [Column2] =EARLIER([Column2])
                                        ),
                         [Column1]
                       )

Which in this case is 4. In regular Excel the A1 reference style is extremely useful but in Powerpivot that A1 cell reference is gone and now we need to talk to the Engine using DAX, which is a language that works with Tables only.

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,179
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top