Forum Discussion
How to count active and inactive users based on login status?
Hi junyetzotomayor,
You can create measures below:
Active = CALCULATE(DISTINCTCOUNT(Table1[UserID]),FILTER(ALLSELECTED('Table1'),'Table1'[Login Status]=1&&Table1[Day]=MAX('Table1'[Day])))
Inactive = CALCULATE(DISTINCTCOUNT(Table1[UserID]),FILTER(ALLSELECTED(Table1),Table1[Day]=MAX('Table1'[Day])))-CALCULATE(DISTINCTCOUNT(Table1[UserID]),FILTER(ALLSELECTED('Table1'),'Table1'[Login Status]=1&& 'Table1'[Day]=MAX('Table1'[Day])))
Best Regards,
Qiuyun Yu
Hi v-qiuyu-msft,
Thanks for the feedback. Just a few more queries below.
1. I added 'Active' and 'Inactive' cards and filters in the PBI. Why is it counting only 1 inactive user wherein all users have at least logged in recordin my specifed timeframe (all dates selected).
2. Why the counts in the cards are showing different from the chart.
- v-qiuyu-msft8 years ago
Community Support
Hi junyetzotomayor,
This is due to the chart has placed Day column in chart X axis, which will filter measures. While you place my measures in card visual, it process whole table and display values based on final day, in your scenario, it's 13. This is expected.
Best Regards,
Qiuyun Yu