Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ArmellA
Frequent Visitor

Count ID's from a table that are not equal to a measure

Hi, 

I'm trying to count how many employees where not there at a specific date which is a slicer/measure

I tried many things with no success. 

IDCount = Calculate(DISTINCTCOUNT(employee[ID]), FILTER(employee,employee[Date]<>Dates[Date])) 
 

Thanks for your help.

ArmellA_1-1675882349260.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ArmellA ,

 

I think Dates table should have a relationship with employee table.

RicoZhou_1-1675936083195.png

You can try this measure.

IDCount = 
VAR _CountAll =
    CALCULATE ( DISTINCTCOUNT ( employee[ID] ), ALL ( employee ) )
VAR _CountInRange =
    CALCULATE (
        DISTINCTCOUNT ( employee[ID] ),
        FILTER ( ALL ( employee ), employee[Date] = SELECTEDVALUE ( Dates[Date] ) )
    )
RETURN
    _CountAll - _CountInRange

RicoZhou_0-1675936070252.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ArmellA ,

 

I think Dates table should have a relationship with employee table.

RicoZhou_1-1675936083195.png

You can try this measure.

IDCount = 
VAR _CountAll =
    CALCULATE ( DISTINCTCOUNT ( employee[ID] ), ALL ( employee ) )
VAR _CountInRange =
    CALCULATE (
        DISTINCTCOUNT ( employee[ID] ),
        FILTER ( ALL ( employee ), employee[Date] = SELECTEDVALUE ( Dates[Date] ) )
    )
RETURN
    _CountAll - _CountInRange

RicoZhou_0-1675936070252.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

FreemanZ
Super User
Super User

hi @ArmellA 

try like:
IDCount =
VAR _date = SELECTEDVALUE(Dates[Date])
RETURN
COUNTROWS(
    FILTER(
        employee,
        employee[Date]<>_date
    )
)
 
the two tables shall be unrelated.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.