Forum Discussion

magnusks's avatar
magnusks
Icon for Helper I rankHelper I
2 years ago
Solved

DIstinctcount based on string in another coloumn

Hi,   I have a table named Projects, that contains a list of projects and various data related to those projects. Some projects are listed multiple times (intentional) due to multiple application p...
  • ValtteriN's avatar
    2 years ago

    Hi,

    You were on the right track. Here is an example on how to make this work:

    Measure 18 = COUNTROWS(
            DISTINCT(
        SELECTCOLUMNS(
        FILTER('Table (25)',CONTAINSSTRING([Category],"Health")),'Table (25)'[Title])))


    End result:

     

     

    Here we first filter the table to contain only rows with "Health". Then we select the distinct categories. Finally COUNTROWS gives us the value we want:

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/