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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

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)

 

 

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.

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.