Forum Discussion
Fab117
Helper IV
3 years agoMeasure to count iteration of specific character string
Hello, I'm newbie with Power BI. I'm quite familiar with VBA, but not at all with Dax => PowerQuery requests. I started building my first Power BI report based on several data base fields, b...
- Anonymous3 years ago
Hi Fab117 ,
I'll first give you a popular science about the difference between M language and DAX language. In Power Query, we'll use M. DAX, which we use in Power BI Desktop.
Here's the solution in Power BI Desktop, which means I used DAX to complete.
Germany = CALCULATE(COUNT('Table'[AreaImpacted]),CONTAINSSTRING('Table'[AreaImpacted],"Germany"))Canada = CALCULATE(COUNT('Table'[AreaImpacted]),CONTAINSSTRING('Table'[AreaImpacted],"Canada"))USA = CALCULATE(COUNT('Table'[AreaImpacted]),CONTAINSSTRING('Table'[AreaImpacted],"USA"))France = CALCULATE(COUNT('Table'[AreaImpacted]),CONTAINSSTRING('Table'[AreaImpacted],"France"))Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
Super User
3 years agoPlease provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523