Forum Discussion

litifeta's avatar
litifeta
Advocate II
10 years ago

Help with a count function in DAX

Having trouble with something that is so simple in Excel

 

I have a column of project names and blanks. I want a measure to calculate the unique text values so I can determine how many projects are in the list.

 

BLANK

Project A

Project A

Project C

Project A

Project B

Project A

 

In the above example the measure should return the value = 3. Thanks ahead of your response

12 Replies

  • Baskar's avatar
    Baskar
    Resident Rockstar

    Its cool in Power BI too.

     

    1. Look the visual levell filter, from there u can choose advance filter, and pick "Is not Blank"

     

    2. Change our measure to "Distinct Count"

     

    let me know if i wont work.

    • litifeta's avatar
      litifeta
      Advocate II

      Still do not know what you mean Baskar. do you mean = DISTINCTCOUNT(<DATA>)

      • Sean's avatar
        Sean
        Community Champion

        litifeta try this measure

         

        Number of Projects =
        CALCULATE (
            DISTINCTCOUNT ( TableName[ProjectsColumn] ),
            FILTER ( TableName, TableName[ProjectsColumn] <> "" )
        )