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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All
I've table with workers, this table have StartWorkDate, and in some cases EndWorkDate.
| Worker | StartDate(dd/mm/yy) | EndDate(dd/mm/yy) |
| Peter | 01/01/2018 | |
| Jhon | 20/05/2018 | |
| Sara | 03/02/2018 | 10/05/2018 |
| Mark | 01/02/2018 |
I need a measure with COUNT the quantity of employees are ACTIVES into a Selected Month (Relative Date Filter).
I try thay
LegActivos =
var SelectDateMin=FIRSTDATE('Date'[Date])
var SelectDateMax=LASTDATE('Date'[Date])
return CALCULATE(DISTINCTCOUNT(leg[worker]);leg[startdate]<=SelectDateMin;ISBLANK(leg[leg_fecegr]) && leg[leg_fecegr] >= SelectDateMax )When I select April, i need to obtain 3 (Sara, Peter and Mark), On May, I obtain 4 .
Solved! Go to Solution.
Hi @pelucapampa,
Please try this measure:
LegActivos =
VAR SelectDateMin =
MIN ( 'Dim date'[Date] )
VAR SelectDateMax =
MAX ( 'Dim date'[Date] )
RETURN
CALCULATE (
DISTINCTCOUNT ( Table9[worker] ),
FILTER (
ALL ( Table9 ),
Table9[StartDate(dd/mm/yy)] <= SelectDateMin
&& (
Table9[EndDate(dd/mm/yy)] = BLANK ()
|| Table9[EndDate(dd/mm/yy)] >= SelectDateMax
)
)
)
Best regards,
Yuliana Gu
Hi @pelucapampa,
Please try this measure:
LegActivos =
VAR SelectDateMin =
MIN ( 'Dim date'[Date] )
VAR SelectDateMax =
MAX ( 'Dim date'[Date] )
RETURN
CALCULATE (
DISTINCTCOUNT ( Table9[worker] ),
FILTER (
ALL ( Table9 ),
Table9[StartDate(dd/mm/yy)] <= SelectDateMin
&& (
Table9[EndDate(dd/mm/yy)] = BLANK ()
|| Table9[EndDate(dd/mm/yy)] >= SelectDateMax
)
)
)
Best regards,
Yuliana Gu
Take a look at these two Quick Measures as I think you want something like them.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 82 | |
| 72 | |
| 46 | |
| 35 |