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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

DISTINCTCOUNT if id each every month.

Hello
I have a 6 moths data. It's web logins. I need a measure, where i could calculate HOW UNIQUE USERS LOGINS EVERY MONTH, and if this users logins every month - return count, and if not logins every moth - not return. 
For example

user_idlogin_dateweb/app 
12022-05-05web 
22022-05-05web 
32022-05-05web 
42022-05-05app 
12022-06-05app 
52022-06-05web 
32022-06-05app 
12022-07-05web 
62022-07-05web 
32022-07-05web 
12022-08-05app 
62022-08-05web 
72022-08-05web 

And this i need:

DateUnique users allUnique u. per periodlogin every month 
month 544  
month 6532 
month 7632 
month 8731 

Thank you. I not have idea. 😞 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

 

Unique users all = CALCULATE(MAX('Table'[user_id]),ALLEXCEPT('Table','Table'[login_date]))
Unique u. per period = CALCULATE(COUNT('Table'[web/app]),ALLEXCEPT('Table','Table'[login_date]))
Measure =
CALCULATE (
    COUNT ( 'Table'[user_id] ),
    FILTER (
        ALL ( 'Table' ),
        [user_id] = SELECTEDVALUE ( 'Table'[user_id] )
            && [login_date] <= SELECTEDVALUE ( 'Table'[login_date] )
    )
)
login every month =
CALCULATE (
    COUNT ( 'Table'[user_id] ),
    FILTER (
        ALL ( 'Table' ),
        [Measure] >= 2
            && [login_date] = SELECTEDVALUE ( 'Table'[login_date] )
    )
)

 

vzhangti_0-1661837618055.png

Is this the result you expect? If I misunderstand, please provide more explanation.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

 

Unique users all = CALCULATE(MAX('Table'[user_id]),ALLEXCEPT('Table','Table'[login_date]))
Unique u. per period = CALCULATE(COUNT('Table'[web/app]),ALLEXCEPT('Table','Table'[login_date]))
Measure =
CALCULATE (
    COUNT ( 'Table'[user_id] ),
    FILTER (
        ALL ( 'Table' ),
        [user_id] = SELECTEDVALUE ( 'Table'[user_id] )
            && [login_date] <= SELECTEDVALUE ( 'Table'[login_date] )
    )
)
login every month =
CALCULATE (
    COUNT ( 'Table'[user_id] ),
    FILTER (
        ALL ( 'Table' ),
        [Measure] >= 2
            && [login_date] = SELECTEDVALUE ( 'Table'[login_date] )
    )
)

 

vzhangti_0-1661837618055.png

Is this the result you expect? If I misunderstand, please provide more explanation.

 

Best Regards,

Community Support Team _Charlotte

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

 

daXtreme
Solution Sage
Solution Sage

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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