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
Anonymous
Not applicable

Count the values of measure without using the filter option in a formula

HI,

 

Is there a way where we can calculate the count of values in a measure without using the filter option.

 

I have this measure 
Note:- [LengthMeasure] is a DAX measure

Count Length = countrows(filter('Sheet1 (2)','Sheet1 (2)'[LengthMeasure]=1

The reason I am looking for this is because  I have a Funnel chart which is distributed in 10 bars and has 10 count measures in it which has filters function in a formala (same as above)

With this filter function my performace has slower down.. very poor performace..

 

Any help is greatly appreacited!

 

Thanks,

Tejaswi

 

1 ACCEPTED SOLUTION

Two option

1. This one should be used without agg.

2. CountX: I was able to add a DAX measure.

 

COUNTX(sales,Sales[RANK Test 1])

 

 

Instead of sales use filter and then you can mention table and filter.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

Try Calculate

 

Count Length = calculate(count('Sheet1 (2)'[LengthMeasure]),'Sheet1 (2)'[LengthMeasure]=1)

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hey Amit!

 

Thanks for your reply!

 

As I mentioned earlier [Lenghtmeasure] is a Dax measure and so I cannot used it as a column in my Calculate fucnton.

Please see the Error as attached.

Capture1.PNG

Do we have any other solutions to this?

Thanks,
Tejaswi 

Two option

1. This one should be used without agg.

2. CountX: I was able to add a DAX measure.

 

COUNTX(sales,Sales[RANK Test 1])

 

 

Instead of sales use filter and then you can mention table and filter.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit..

I accidently hit on Accept solution..

However I still have a question.

as I said filter function is causing my report to works slowly i want to know if there is any other solutions.

 

Also in my lenght measure I have two values (1 and 2.) which are whole numbers and I want to get the count of only 1s in this measure.

 

any help!

 

Thanks,

Tejaswi

Is it not possible to put a visual level filter on this measure. That will reduce data. Post that any measure will count. 

 

Screenshot 2019-09-10 22.03.05.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

HI @amitchandak ,

 

Thank you for your reply!

Having the visual level filter won't work in my case.

 

I am using my measures in a funnel chart and I am making the report interactive between the funnel and Table visual. The funnel has all the 10 measures .my table visual also has 10 columns and I am highlighting the cells in each columns based on some criterias for each of the fields in  a table..The highlighted cells are the actual 1s. and I am counting all the 1s in each column, so that i know how many cells are highligted in each Coumns of table visual .

 

I hope it is clear.

 

Thanks,

Tejaswi

 

 

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!

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.