'Power BI Distinct Count (Account Number) on Min Date

I have a table with account numbers and dates for logins. The same account number can show on multiple dates. I need to do a distinct count of the account numbers on their min date.

Example

Account  Date        =>> Distinct Count      Date
1        1/8/2022                     2      01/08/2022
1        1/8/2022                     1      01/11/2022
1        1/10/2022
2        1/11/2022
2        1/12/2022
3        1/8/2022
3        1/8/2022
3        1/11/2022


Solution 1:[1]

Try with measure where we produce table variable with MinDate for each Account. And we can use this to countrows.

CountForMinDate = var __tex = ADDCOLUMNS(VALUES('Table'[Account]), "MIN", CALCULATE(MIN('Table'[Date])))
return

CALCULATE( countrows(__tex))

Based on your sample data

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 msta42a