Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have a table consisting of title of projects and the principal investigator (PI) for those projects. The projects in this table are projects that have applied for external funding. Due to this, some of the projects are listed several times, thus I cannot remove duplicates in the power query since I need them for others measures (i.e. number of applications sent for external funding).
Lets get back to the problem at hand. I want to calculate which "PI" has the most number of "projects".
Table name: Allprojects
Project | PI |
A | Anna |
B | Anna |
A | Anna |
C | John |
D | Mike |
E | Elsa |
I have tried this measure (see below), but it returns that Anna has 3 projects. But as you can see, she only has 2 distinct ones. I want the output to be: Anna: 2
Thanks
Solved! Go to Solution.
hi @magnusks
Reposting. This is a better solution.
Hi @magnusks ,
@talespin nice method! And based on the sample and description you provided, you may also consider using the following code.
Mostprojects PI =
var _table=
SUMMARIZE(
'Table','Table'[PI],
"Count",CALCULATE(DISTINCTCOUNT('Table'[Project]),ALLEXCEPT('Table','Table'[PI])))
var _table2=
FILTER(
_table,[Count]=MAXX(_table,[Count]))
return
MAXX(_table2,'Table'[PI])&": "&MAXX(_table2,[Count] )
Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @talespin
Thanks. I tried the dax you suggested, but it only returns the no of distinct projects. I want it to also dispay the name of the PI with the most distinct prosjects.
Thanks
hi @magnusks ,
Please share what result you expect, This measure works for both visuals in screenshot. The count is at PI level.
Hi @talespin
Im expecting a result that allows me to create a card that looks something like this
(But with 2 instead of 3).
Thanks
hi @magnusks
Reposting. This is a better solution.
Thank you - that worked 👍
hi @magnusks
Please use this.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |