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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calculate the number of active users depending on conditions

Hi all,

back to DAX after a while and I am a bit rusty. Can someone help me building a formula?

 

I have a calendar table I use as a slicer.

I have a table with the user data and with one record for each visit in the "Visit Date" column.

I would like to create a measure, so, when for example someone chooses "February 2022" in the slicer, it returns the number of active users for that time period (I will have other slicers like account name and so on.

An active user is considered who had at least one visit date for that given calendar month.

 

Would be possible to get help with this formula?

Thanks a lot!

1 ACCEPTED SOLUTION

No specific reason. I assumed there would be a 1:1 mapping between account ID and email based on the sample you provided. Using the email column should give you the same result.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

View solution in original post

5 REPLIES 5
rohit_singh
Solution Sage
Solution Sage

Hi @Anonymous 

Ensure that you have a relationship defined between your data table and the date table.

rohit_singh_0-1652970789143.png

 

Once that is done, create a measure like below :

Active Users =

CALCULATE(
DISTINCTCOUNT(UserEmail[Account ID]),
ALLSELECTED(dim_date[MonthYear])
)
 
 This gives us
 rohit_singh_1-1652971148132.png

Please note that whatever field you use as the slicer for month must be used in the highlighted part in the measure. I have used the monthyear field in my example.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

Anonymous
Not applicable

Any reason why you use UserEmail[Account ID] instead of UserEmail[Email]?

No specific reason. I assumed there would be a 1:1 mapping between account ID and email based on the sample you provided. Using the email column should give you the same result.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

Anonymous
Not applicable

@rohit_singh unfortunately I can't share the original data because it is confidential but it looks something like this:

EmailVisit DateAccount ID
emaila@test.com1/1/2022

ABCD

emaila@test.com12/1/2022

ABCD

emaila@test.com26/2/2022

ABCD

emailb@test2.com15/1/2022

EFGH

emailb@test2.com18/3/2022

EFGH

 

And so on...So in the example above in Jan I have 2 active users and in Feb and March 1 per month.

 

And I have a connection between the Visit Date and a Date Helper table like this:

Andmi00_0-1652969427367.png

 

rohit_singh
Solution Sage
Solution Sage

Hi @Anonymous ,

Please provide sample data in text format (not a screenshot) and the expected output.

Kind regards,

Rohit

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors