Forum Discussion
New Users measure
Hi,
I have a table where I have all the logins for each user, one line is one login.
I have a calculated column retrieving the registration date from another table via LOOKUPVALUE. I made this measure to be able to filter the data and see who are the "New" users for a specific month. A "New" user is defined as someone who has the registration date in a specific month. I am then filtering the dates with one or more months.
I created this that works but not in all cases, someone can help to debug it?
New Users Measure=
VAR NewUsers =
FILTER (Table_Visitors,
CONTAINS ( VALUES ( 'calendar'[Date] ), 'calendar'[Date], Table_Visitors[Registration Date] )
)
RETURN
COUNTROWS(SUMMARIZE(NewUsers,Table_Visitors[Visitor ID]))
Thank you for your help!
Hi Anonymous ,
Sorry for late back. Yes, for multiple lines in different month it also works. If in the same month there're multiple lines and you want to count all the lines, change the formula to:
Measure = CALCULATE ( DISTINCTCOUNT ( Table_Visitors[Visitor ID] ), FILTER ( 'Table_Visitors', COUNTROWS ( FILTER ( 'Table_Visitors', 'Table_Visitors'[Month] = MAX ( 'calendar'[Month] ) ) ) > 0 && COUNTROWS ( FILTER ( 'Table_Visitors', 'Table_Visitors'[Month] = MAX ( 'calendar'[Month] ) - 1 ) ) = 0 ) )Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
8 Replies
- MFelix
Super User
Hi Anonymous ,
Without any data is difficult to understand where your measure is breaking.
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message. - v-yanjiang-msft
Community Support
Hi Anonymous ,
According to your description, I create a sample.
Table_Visitors:
Calendar table:
The two tables are related with date columns.
Create a measure.
Measure = CALCULATE ( DISTINCTCOUNT ( Table_Visitors[Visitor ID] ), FILTER ( 'Table_Visitors', COUNTROWS ( FILTER ( 'Table_Visitors', 'Table_Visitors'[Month] = MAX ( 'calendar'[Month] ) ) ) > 0 && COUNTROWS ( FILTER ( 'Table_Visitors', 'Table_Visitors'[Month] = MAX ( 'calendar'[Month] ) - 1 ) ) = 0 ) )Get the result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thank you v-yanjiang-msft but in my Table_Visitors the same visitor can be in multiple lines (multiple logins), even though the registration date would be the same. Does your measure work also in this case?
- v-yanjiang-msft
Community Support
Hi Anonymous ,
Sorry for late back. Yes, for multiple lines in different month it also works. If in the same month there're multiple lines and you want to count all the lines, change the formula to:
Measure = CALCULATE ( DISTINCTCOUNT ( Table_Visitors[Visitor ID] ), FILTER ( 'Table_Visitors', COUNTROWS ( FILTER ( 'Table_Visitors', 'Table_Visitors'[Month] = MAX ( 'calendar'[Month] ) ) ) > 0 && COUNTROWS ( FILTER ( 'Table_Visitors', 'Table_Visitors'[Month] = MAX ( 'calendar'[Month] ) - 1 ) ) = 0 ) )Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-yanjiang-msft
Community Support
Hi Anonymous ,
Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!
Best Regards,
Community Support Team _ kalyj - Josh_Boj
Advocate I
It would be nice to have one location to manage all users
https://ideas.powerbi.com/ideas/idea/?ideaid=e413d9e7-f785-ed11-a76e-281878bd14b2