Forum Discussion
GSTI08
5 years agoFrequent Visitor
DAX function to search for multiple values in strings and count the number of times each value occur
Hoping someone can help, I am new to DAX. I am trying to count the number of times specific texts occurs. I have a table/Column with multiple values in it. Regions Europe, ME, UKI ...
- 5 years ago
Hi GSTI08 ,
It is suggested to create another region table by DAX or just enter data.
Region = DATATABLE ( "Region", STRING, { { "Africa" }, { "South America" }, { "ME" }, { "North America" }, { "UKI" }, { "Europe" } } )Then, create measures like what Greg_Deckler provided.
4 CalcRegion = VAR __SearchTerms = ADDCOLUMNS ( Regions, "Count", COUNTROWS ( FILTER ( 'Accounts', FIND ( [Region], 'Accounts'[Primary Connectivity Regions],, 0 ) > 0 ) ) ) RETURN SUMX ( __SearchTerms, [Count] )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GSTI08
5 years agoFrequent Visitor
Thank you very much everyone for you help, particulary Greg and Icey,
This is working perfectly!
Really appreciate everyone's effort.