cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

How to count values in a column

Hi,

 

I have a calculated column % Worked = (AVS[Real Act Min]/AVS[scheduledMinutes]). I want to count the amount of times

the value in % Worked is <=79. Thought this should work but it's not -> 79 = COUNTROWS(FILTER(AVS,[% Worked]<=79))

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: How to count values in a column

So, just create a calculated column like:

 

79 = IF([% Worked]<=79,1,0)

Then you can just do a COUNT aggregation on [79].


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Microsoft
Microsoft

Re: How to count values in a column

@android1

The value is the actual data, regardless of the date format,  change the 79 to 0.79, then if should behave as expected
Capture.PNG

 

Regards,

Charlie Liao

View solution in original post

8 REPLIES 8
Highlighted
Super User IV
Super User IV

Re: How to count values in a column

Try:

 

CALCULATE(COUNTROWS(AVS),AVS[% Worked]<=79)

---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Post Patron
Post Patron

Re: How to count values in a column

Still not getting correct results -> lessthan79.jpg

Highlighted
Super User IV
Super User IV

Re: How to count values in a column

Oh, >slaps self in forehead<, I understand what you are going for now, (I think). Can you post some sample data and your expected results? That way I can be sure I answer the correct problem.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Post Patron
Post Patron

Re: How to count values in a column

Samp Data.jpg

 

 

Highlighted
Super User IV
Super User IV

Re: How to count values in a column

So, just create a calculated column like:

 

79 = IF([% Worked]<=79,1,0)

Then you can just do a COUNT aggregation on [79].


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Post Patron
Post Patron

Re: How to count values in a column

Still getting the exact same results using a column

 

Samp 2.jpg

Highlighted
Post Patron
Post Patron

Re: How to count values in a column

My measure [% Worked] is formatted as percentage. Could this be causing the unexpected results?

 

Highlighted
Microsoft
Microsoft

Re: How to count values in a column

@android1

The value is the actual data, regardless of the date format,  change the 79 to 0.79, then if should behave as expected
Capture.PNG

 

Regards,

Charlie Liao

View solution in original post

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors