March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a table with time booking data like -
Date User Activity Hours
01/01/2019 Name A Work 5
01/01/2019 Name A Annual Leave 5
01/01/2019 Name B Work 10
01/01/2019 Name C Work 10
02/01/2019 Name A Work 10
02/01/2019 Name D Annual Leave 10
02/01/2019 Name C Work 12
And a lookup table with ranks like -
User Rank
Name A Manager
Name B Manager
Name C Associate
Name D Employee
I want create a measure, or a combination of measures, to count the distinct number of users per date, but return the count of each rank per date.
So for 01/01/2019 it would return Manager = 2, Associate = 1
for 02/01/2019 it would return Manager = 1, Associate = 1, Employee = 1
Count of User total for Date =
CALCULATE(
DISTINCTCOUNT('Table'[User]),
ALLSELECTED('Table'[Date])
)
Is it possible to return a count of the rank per date based on distinct users per date?
Thanks for any help!
Solved! Go to Solution.
hi @peterver
For your case, adjust your model as below:
1. Create a relationship between between two tables by [User] column.
2. Adjust the measure as below:
Count of User total for Date =
CALCULATE(DISTINCTCOUNT('Table'[User]))
3. Create a visual that contains [Rank] column,[Date] column and this measure.
and here is my sample pbix file, please try it.
Regards,
Lin
hi @peterver
For your case, adjust your model as below:
1. Create a relationship between between two tables by [User] column.
2. Adjust the measure as below:
Count of User total for Date =
CALCULATE(DISTINCTCOUNT('Table'[User]))
3. Create a visual that contains [Rank] column,[Date] column and this measure.
and here is my sample pbix file, please try it.
Regards,
Lin
Just include your Rank column in your visual?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |