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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Everyone
Below is a simplified version of my actual table.
I have a slicer where a user can select an Employer name ( A,B,C,D), when they choose an employer I want to get a count of all of the selected IDs in the table. Here is my current formula..
| Employer | ParentEmployerID | |
| A | 1 | |
| AA | 1 | |
| C | 3 | |
| D | 4 | |
| AA | 1 | |
| A | 1 | |
| AA | 1 | |
| D | 4 | |
| DD | 4 |
Solved! Go to Solution.
The original formula takes into account that you might select more than one value which, in this case, SELECTEDVALUE will not work. If you want just a single selection:
Number of Parent IDs =
VAR __PARENT_ID =
CALCULATE ( MAX ( 'Table'[ParentEmployerID] ), ALLSELECTED ( 'Table' ) )
RETURN
CALCULATE (
COUNTROWS ( 'Learning Plan' ),
'Learning Plan'[ParentID] = __PARENT_ID,
USERELATIONSHIP ( 'Learning Plan'[EmployerId], Employer[EmployerId] )
)
Hi @SBR1D ,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @SBR1D
With just the data provided, here's a sample formula:
Number of Parent IDs =
VAR __PARENT_ID =
SUMMARIZE (
CALCULATETABLE (
'Table',
'Table'[Employer] IN VALUES ( 'Table'[Employer] ),
REMOVEFILTERS ()
),
'Table'[ParentEmployerID]
)
RETURN
CALCULATE (
COUNTROWS ( 'Learning Plan' ),
'Learning Plan'[ParentID] IN __PARENT_ID,
USERELATIONSHIP ( 'Learning Plan'[EmployerId], Employer[EmployerId] )
)
Otherwise, please provide a sanitized copy of your pbix.
That looks good but what about the selected value part please?
The original formula takes into account that you might select more than one value which, in this case, SELECTEDVALUE will not work. If you want just a single selection:
Number of Parent IDs =
VAR __PARENT_ID =
CALCULATE ( MAX ( 'Table'[ParentEmployerID] ), ALLSELECTED ( 'Table' ) )
RETURN
CALCULATE (
COUNTROWS ( 'Learning Plan' ),
'Learning Plan'[ParentID] = __PARENT_ID,
USERELATIONSHIP ( 'Learning Plan'[EmployerId], Employer[EmployerId] )
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 78 | |
| 66 | |
| 65 |