Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi guys,
I have the below database table based on the login status of Users on our system.
2 - Inactive
1 - Active
I'm trying to count the users who logged-in (and didn't logged-in) for specific days. For simpler illustration purposes, let's take June 12 and July 12 2018 as an example (queried in database above).
As you can see, I selected in my filter Months June and July with the 3 users. Ideally it shouldn't count more than 3 in all of the bar chart since we only have 3 users.
Basically the general rules are
1. If user is “Active” even for ONE day then we should include that user only in the “ACTIVE” user count.
2. If the user is not all “Active” for the entire period then ONLY we should show that user in the “Inactive user” group.
Meaning to say, for the 12th day, it should only count 1 INACTIVE USER and not 3. My "Value" in chart is "Count of UserID".
I manage to succesfully count it in the measure in the "inactive users" and "active users" below but wasn't successful in implementing this as well in the chart.
Can you please help me on this one? Thanks!
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.
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
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
117 | |
101 | |
71 | |
61 |