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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I am having an issue.
I have a report that needs to show a list of "eligible" clients. Eligiblity is determined by having 2 or more completed services in the date range that is selected. Because the date range is a slicer I can't use a calculated collumn to determine eligibility. I tried using a virtual table but I can't seem to get the count of services to work. It will limit the list of clients counted to those that had at least 1 service but I can't get it to limit to those that had 2 services. Any ideas on how to procede? Here is the measure I am using right now. The column for "CountOfServices" seems to be returning the same count for every client. The measure returns the same value wether I have a filter on it or not.
Solved! Go to Solution.
Eligible Population =
VAR Tab1 =
CALCULATETABLE(
Addcolumn(
Values(dwh FactService'[clientID]),
"@CountOfServices",
Calculate( distinctcount(factService'[ProcedureKey])
),
'dwh FactService'[ProcedureKey] in {99, 136, 60, 123, 124, 125, 126, 65, 66, 67, 68}
&&
'dwh FactService'[Full Service Date] <= MAX('dwh DimDate'[SmallDate])
&&
'dwh FactService'[Full Service Date] >= MIN('dwh DimDate'[SmallDate])
&&
'dwh FactService'[Age at Time Of Service] > 17
&&
'dwh FactService'[ServiceStatusName] = "Complete"
)
RETURN
COUNTROWS(
FILTER(
tab1,
[@CountOfServices] > 1
)
)
Assumed you wanted count of distinct procedure key, swap back to count if not
You needed calculate to get context transition, so the row context of client id filtered the procedures
Thank you so much for the help.
I am looking for a total count of procedure key. Because the criteria is 2 or more completed in the list of procedure keys. But easy fix.
I actually tried to use calculate but it wasn't returning anything when I did. I am guessing using Addcollumns instead of Selectcollumns might have made a difference to.
Either way, it is working now.
Thanks again
Eligible Population =
VAR Tab1 =
CALCULATETABLE(
Addcolumn(
Values(dwh FactService'[clientID]),
"@CountOfServices",
Calculate( distinctcount(factService'[ProcedureKey])
),
'dwh FactService'[ProcedureKey] in {99, 136, 60, 123, 124, 125, 126, 65, 66, 67, 68}
&&
'dwh FactService'[Full Service Date] <= MAX('dwh DimDate'[SmallDate])
&&
'dwh FactService'[Full Service Date] >= MIN('dwh DimDate'[SmallDate])
&&
'dwh FactService'[Age at Time Of Service] > 17
&&
'dwh FactService'[ServiceStatusName] = "Complete"
)
RETURN
COUNTROWS(
FILTER(
tab1,
[@CountOfServices] > 1
)
)
Assumed you wanted count of distinct procedure key, swap back to count if not
You needed calculate to get context transition, so the row context of client id filtered the procedures
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 51 | |
| 36 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |