Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all!
As I've specified on the title, I'm trying to get the id (In my case, a username) with the maximun number of repetitions on a table, in the last month. More specifically, I need to search what user make the most number of commits on last month, and display the username on a view.
I have this two tables:
Someone can tell me what can i do?
Thanks in advance!
Solved! Go to Solution.
@ImaginaCorregir
Try this measure and you may my sample in the pbix below:
Measure = CALCULATE(MAX('Usuarios'[Nombre]),FILTER('Datos commits', [Usuario] = CALCULATE(COUNT([Usuario]),FILTER(ALL('Datos commits'),[Usuario]=MAX('Datos commits'[Usuario])))))
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Measure like
commits = count(Table[ID commit])
Create Rank and filter or have top N
rank = rankx(all(Table[userio]),[commits])
Top 5 = CALCULATE([commits],TOPN(5,all(Table[userio]),[commits],DESC),VALUES(Table[userio]))
Hi @amitchandak, thanks for the quick reply.
I've just try that but It's not working as I expected. Thats the code:
MayorContribuidorMes =
VAR commits = COUNT('Datos commits'[ID Commit])
VAR rankUsuario = RANKX(ALL(Usuarios[Nombre]), commits)
RETURN CALCULATE(
commits,
TOPN(1, ALL(Usuarios[Nombre]), commits, DESC),
VALUES(Usuarios[Nombre])
)
And on my view I'm seeing the total number of commits:
Also, I cant see on that Dax function where it's filtering commits table by date (by last month). I have managed to create this code for it:
VAR commitsLastMonth = FILTER(
'Datos commits',
AND(
YEAR([Fecha]) = YEAR(TODAY()),
MONTH([Fecha]) = MONTH(TODAY())
)
)
@ImaginaCorregir
Try this measure and you may my sample in the pbix below:
Measure = CALCULATE(MAX('Usuarios'[Nombre]),FILTER('Datos commits', [Usuario] = CALCULATE(COUNT([Usuario]),FILTER(ALL('Datos commits'),[Usuario]=MAX('Datos commits'[Usuario])))))
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |