Forum Discussion
Measure to count iteration of specific character string
- Anonymous4 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.
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.
Hi Anonymous ,
Thank you very much for taking time looking at my challenge and for this solution which fit perfectly my needs.
Have a nice week.
Fab