Forum Discussion

Moni's avatar
Moni
New Member
4 years ago
Solved

To calculate distinctcount date with text type

I gotta column with weekending dates and another coulumn with full name, so im trying use DAX to calculate distinct value of each full name with no of weeks, 

 

I'm getting error with full name as text type cannot be used as true/false or text type cannot be used in filter with distinct count.

 

can anyone help me please.

 

I want output to be gareth 2 weeks, Darran 1 week (since 12/11/21 repeating so distinct count)

  • Moni just to be sure, you put 'Table[Full Name] on rows of the matrix and created this measure:
    Distinct Weeks Measure = DISTINCTCOUNT('Table'[Week Ending]) 
    And put that measure on the values and it didn't work?

7 Replies

  • SpartaBI's avatar
    SpartaBI
    Community Champion

    Moni just to be sure, you put 'Table[Full Name] on rows of the matrix and created this measure:
    Distinct Weeks Measure = DISTINCTCOUNT('Table'[Week Ending]) 
    And put that measure on the values and it didn't work?

    • Moni's avatar
      Moni
      New Member

      Hi SpartaBI 

      I tried those measures, it calculates distinctcount of weekending but not name, example it shows

       

      Darren 7 weeks

      Gareth 2 weeks

       

      but i expect answer,

       

      Daren 2 weeks (since 12/11/2021, 19/11/2021 only two days are ter)

      • SpartaBI's avatar
        SpartaBI
        Community Champion

        Moni maybe these values are not really unique in the data. How did you created this column? Do you have maybe a sample data you can share?