Forum Discussion
New Users measure
- 3 years ago
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.
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 _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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-msft3 years ago
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.
- Anonymous3 years agoNot applicable
v-yanjiang-msft it is the same formula, I don't want to double count someone if they are having 2 logins for that month. How do I edit the formula? At the moment if someone is a new user in January for example but they have 2 logins it shows 2 instead of 1.
- v-yanjiang-msft3 years ago
Community Support
Hi Anonymous ,
Do you mean only count twice for user in there registrate month?
For ex, a user registrate at January, if he login twice in January, it counts twice. But if he login in twice in February, it only counts once?
Best Regards,
Community Support Team _ kalyj