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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
janegrnisppl
New Member

Help with Count with Filters

Hello! I have been reading other solutions for filtering in count measures but so far no luck with mine. Here is my code for a measure:

 

Total active facilities = CALCULATE(DISTINCTCOUNT('FFAFacilities'[FACILITY_ID]),FILTER('FFAFacilities','FFAFacilities'[CURRENT_STATUS]="01"))

 

The code doesnt like the filter. It is a string and I tried copying the column and making it a whole number and then filtering it by the value 1 but that also did not work. I also tried all different variations of count so it has something to do with the filter value. Any suggestions would be awesome. 

 

Thanks!

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @janegrnisppl ,

 

Where do you want to apply this measure to? This measure may be affected by the context.

Based on your description, I have created a simple sample:

vjianbolimsft_1-1666085425799.png

 

Please try something like:

Total active facilities = CALCULATE(DISTINCTCOUNT('FFAFacilities'[FACILITY_ID]),FILTER(ALL('FFAFacilities'),'FFAFacilities'[CURRENT_STATUS]="01"))

Final output:

vjianbolimsft_0-1666085378615.png

 

Best Regards,

Jianbo Li

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
v-jianboli-msft
Community Support
Community Support

Hi @janegrnisppl ,

 

Where do you want to apply this measure to? This measure may be affected by the context.

Based on your description, I have created a simple sample:

vjianbolimsft_1-1666085425799.png

 

Please try something like:

Total active facilities = CALCULATE(DISTINCTCOUNT('FFAFacilities'[FACILITY_ID]),FILTER(ALL('FFAFacilities'),'FFAFacilities'[CURRENT_STATUS]="01"))

Final output:

vjianbolimsft_0-1666085378615.png

 

Best Regards,

Jianbo Li

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

rsbin
Super User
Super User

@janegrnisppl ,

Can you please post a small sample of your FFAFacilities table or attach your pbix file after removing sensitive data.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors