Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi community,
I have two tables
People table:
| People name | People id |
| Amy | 001 |
| Peter | 002 |
| Paul | 003 |
Poject table:
| People ID | project ID |
| 001 | XX |
| 001 | YY |
| 001 | ZZ |
| 002 | XX |
| 002 | YY |
| 003 | ZZ |
| 004 | ZZ |
| 004 |
I connected two tables with one to many relationship by People ID.
My task is that once the people name is selected in the slicer, I need to calculate number of people participate in the same project.
For example, If I select Amy in the slicer, Amy participated in Project XX, YY and ZZ, and I see people ID 002, 003, 004 also participated in the projects that Amy has participated in, so the total number of people partcipated in Amy's project are 4 (001, 002, 003, 004).
I tried to extract the list of project that Amy has partcipanted in with below measure
Number of related project =
var selectedPeople = SELECTEDVALUE(People[People Name])
return
calculate(
distinctcount(project[project ID]),
People[People Name] = selectedPeople
)
This measure only count the number of projects Amy has partcipating.
The question is how to distinct count the number of people who share the same project with selected people in slicer?
@Anonymous , In sunc case prefer to use an independent people table
Number of related project =
var _tab = summzarize(filter(project, project[People ID] in SELECTEDVALUE(People[People ID])), [Project ID]
return
calculate(
distinctcount(project[project ID]),filter( project, project[Project ID] in _tab))
or when joined
Number of related project =
var _tab = summzarize(filter(project, project[People ID] in SELECTEDVALUE(People[People ID])), [Project ID]
return
calculate(
distinctcount(project[project ID]),filter( project, project[Project ID] in _tab), removefilter(People) )
Hi @amitchandak,
Thanks for replying. Could you explain more on two measures you provide?
I tried to create those measure, but there are syntax error in the var _tab.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 39 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 34 | |
| 32 | |
| 29 |