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 " )
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
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
- tahmed9 years agoAdvocate II
Create a new Table 2:
Table 2:
Col 1 = DISTINCT ('Table 1' [Name Column])
Col2 = COUNTROWS (RELATEDTABLE ('Table 1')
That should do it.
- FRANKADVIES9 years agoFrequent Visitor
Hi,
I have the same problem as above, but I want an extra column in the original table in which for each row is determined how many times the name occurs in the table. What Dax formula do I have to use for this?
- chauhai8 years agoRegular Visitor
Hi,
Were you ble to resolve the issue? I am trying to replicate the countif functionality of excel in power BI.