Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
In Power Bi, I have a 'public dailyusagereport' with 2 columns called "Name" and "LastLoginDate". My input table as data from Aug 2023 to 6th Nov2024
1.I have provided the date range in the slicer of the dashboard, which shows the dates from Aug 2023 till 6th Nov 2024. As soon as the user selects the dates I am creating the new intermediate table named DateFilteredDailyUsageReport based on the selected date range.
2. I calculated how many times users are loggedin in Past X days within the date range. my output is coming as below as expected
Name LoginCount
0520177 20
0539179 20
0524535 20
0526162 20
0563914 19
0577696 19
0558652 19
0583882 19
0583503 19
I achieved this with the following simple measure
LoginCountPerUserMeasure =
CALCULATE(
COUNTROWS('DateFilteredDailyUsageReport'), -- Count distinct login days per user
FILTER(
'DateFilteredDailyUsageReport',
'DateFilteredDailyUsageReport'[FormattedDate] >= [StartDateSelected] &&
'DateFilteredDailyUsageReport'[FormattedDate] <= [EndDateSelected] && -- Respect the selected date range
WEEKDAY('DateFilteredDailyUsageReport'[FormattedDate], 2) < 6 -- Only weekdays (Mon-Fri)
)
)
3. Now I would like to achieve how many users are there with same logincount. So I want my 4th step output like first column should be LoginCount second column should be how many users are logged in for example below
LoginCount Number of Users
19 5
20 4
Solved! Go to Solution.
var currNum = SelectedValue(LoginCount[Value]) --capture the current rows login count
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Create a calculated table
LoginCountSummary =
SUMMARIZE(
ADDCOLUMNS(
VALUES('DateFilteredDailyUsageReport'[Name]),
"LoginCount",
CALCULATE(
COUNTROWS('DateFilteredDailyUsageReport'),
FILTER(
'DateFilteredDailyUsageReport',
'DateFilteredDailyUsageReport'[FormattedDate] >= [StartDateSelected] &&
'DateFilteredDailyUsageReport'[FormattedDate] <= [EndDateSelected] &&
WEEKDAY('DateFilteredDailyUsageReport'[FormattedDate], 2) < 6
)
)
),
[LoginCount],
"Number of Users", COUNTROWS(VALUES('DateFilteredDailyUsageReport'[Name]))
)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Hi @chetanpatel14 ,
To achieve your desired output, you need to group the users by their LoginCount and count how many users fall into each group. Here’s how you can achieve this in Power BI:
Write a DAX Table Calculation
Use the following DAX formula to create a new calculated table that groups the data and counts the number of users for each LoginCount:
LoginCountSummary =
SUMMARIZE(
ADDCOLUMNS(
DISTINCT('DateFilteredDailyUsageReport'[Name]),
"LoginCount", [LoginCountPerUserMeasure]
),
[LoginCount],
"Number of Users", COUNTROWS(VALUES('DateFilteredDailyUsageReport'[Name]))
)
Output
The table visual should display:
Login Count | Number Of Users |
19 | 5 |
20 | 4 |
This will dynamically reflect changes in the slicer selection. Let me know if you need further assistance!
If I have resolved your question, please consider marking my post as a solution. Thank you!
Above provided DAX is not working, I already validated. This will not respect the date range which user selected, it calculates the output for entire dataset from the sourcetable. It will not calculate based on the intermediate table which I created based on the date slicer
Your question is very similar to this one:
https://community.fabric.microsoft.com/t5/Desktop/Need-to-change-the-category-and-counts/m-p/4287005...
You need to create a data table that contains the number of Logins you want to test for.
If you just want numbers you could use LoginCount = GenerateSeries(1,100,1) that will generate a list of numbers 1 to 100.
Then you can use this in your table visual along with a measure:
var currNum = SelectedValue(LoginCount[Value]) --capture the current rows login count
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi,
I didn't get this one
var logintable = --Create a virtual version of your table, calc for each person their login no. How to create this. Can you please provide the steps to achieve the desired output.
Thanks again for your response.
If you mean this bit:
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi,
Thanks for your quick response, I already created the table with the series, What I asked is I didn't understood the below code.
var currNum = SelectedValue(LoginCount[Value]) --capture the current rows login count
var currNum = SelectedValue(LoginCount[Value]) --capture the current rows login count
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi, Thanks for your solution it worked. I did below steps
1. Created new table
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.