Forum Discussion
DAX function to count specific text values from a column
- 10 years ago
You need to write a formula like which will count all the rows containing "This Value"
CountValues = CALCULATE ( COUNTROWS ( TableName ); TableName[ColumnName] = " This Value " )
Rodrigo Measure = COUNTROWS(FILTER(Raw, Raw[Sat Lv]=4))
If for some reason 4 is not a number - use ="4"
Sean thanks, I was able to calculate the values without any problem.
another question here....
another calc problem here, I need to calculate how many times the word "communication" appears on a column but. the word communication is part of a text inside the row. example below:
Column 1
asdfoaisdfhoasd communication sedfadsfadsfad
comunication e2erawedfasdfads
adsfqefcomunication
the asnwered should be 3 .... as the word communication appears 3 times in column A
please help. thanks
- karthik10 years agoAdvocate I
Create a calculated column in the table as follows:
HasCommunication := IF (Find("Communication",your_text_column,1,-1) = -1, 0, 1)
Create a new measure as CommunicationCount = SUM([HasCommunication]) in the same table where you created a new column "HasCommunication"
- dsilveira9 years agoAdvocate I
Hi karthik
thanks for your comments. I was reading, but in case I need count how often all the rows repeat (of course I can't specificate the world) For example:
Table:
Jim
Tom
Tom
Mary
Jim
Jim
I would like to Return:
Jim 3
Tom 2
Tom 2
Mary 1
Jim 3
Jim 3
Thanks you very much!
- PowerBIUser39 years agoFrequent Visitor
Were you able to solve this? I am also interested