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

CALCULATE count of several text values

Hi,

 

I am rying to calculate the number of times 3 different strings appear in a column.

This measure works for one value -> CountPunctuality = CALCULATE(COUNTROWS(OTIF),OTIF[Punctuality] = "On Time")

 

 

I need to also count the number of times 2 other strings appear in the same column. Tried using or , & but nothing's working.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: CALCULATE count of several text values

@android1 You can either create Measures for EACH one - the same as before

Just change "On Time" - so you'll have 3 Measures

Or do as in the picture...

Create a Table => drag the column twice to the Values area => the second column change to Count

This is faster but you'll have more flexibility later on if you create the individual Measures

IF - Arrival Time - Late or On Time.png

View solution in original post

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: CALCULATE count of several text values

@android1 Try this...

 

CountPunctuality =
COUNTROWS ( FILTER ( OTIF, OTIF[Punctuality] = "On Time" ) )
Highlighted
Post Patron
Post Patron

Re: CALCULATE count of several text values

Hi Sean,

 

How do I add 2 more text values to this. I want to count the number of times 'On Time', 'Late', 'Early' 

appears in the column.

 

Thanks

Highlighted
Community Champion
Community Champion

Re: CALCULATE count of several text values

@android1 You can either create Measures for EACH one - the same as before

Just change "On Time" - so you'll have 3 Measures

Or do as in the picture...

Create a Table => drag the column twice to the Values area => the second column change to Count

This is faster but you'll have more flexibility later on if you create the individual Measures

IF - Arrival Time - Late or On Time.png

View solution in original post

Highlighted
Post Patron
Post Patron

Re: CALCULATE count of several text values

That's great. Thanks for your help Sean.

Highlighted
Advocate II
Advocate II

Re: CALCULATE count of several text values

I have a question that is a bit similar, but i need to make a distinct count

Helpful resources

Announcements
June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

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.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors