DAX - Filter on Same Column for Unique Values

gavs73

Board Regular
Joined
Apr 22, 2008
Messages
138
Hi, would appreciate any help with this, I have a list of accounts with an Active Date, which is updated every month and account is live.

I want to count the Unique Accounts in Month 1 NOT IN Month 2, i.e. those which have been LOST, and

I want to count the Unique Accounts in Month 2 NOT in Month 1, i.e. those which are NEW.

In SQL I believe I could just delete one list from the other and count the remainders, is there a similar function in PowerBI DAX ?

Thanks in advance for any help.

Gav


P1Move =

VAR EndDate1 = DATE(2021,01,31)

VAR StartDate1 = DATE(2021,01,01)

VAR EmdDate2 = DATE(2020,12,31)

VAR StartDate2 = DATE(2020,12,01)


VAR UniqueCnt = CALCULATE(

(DISTINCTCOUNT(CorpBill[AccountID])),

CorpBill[xdate]>=StartDate1,CorpBill[xdate]<=EndDate1),

NOT IN ? – Is there DAX for this ?

FILTER(CorpBill[AccountID],

(CorpBill[xdate]>=StartDate2,CorpBill[xdate]<=EndDate2))

)

Return

UniqueCnt
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,225,577
Messages
6,185,792
Members
453,330
Latest member
NAtyNat29

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