Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
71 | |
38 | |
31 | |
27 |
User | Count |
---|---|
91 | |
49 | |
44 | |
39 | |
35 |