Forum Discussion

pstanek's avatar
pstanek
Post Patron
10 years ago

Dax

Problem 1

Name 1 Number 1

.

.

Name n  Number n.

 

How can I calculate column with values Number i / Count( Name i).

 

Problem 2

How can I calculate number of blank values.

When I transform column TEXT to TEXT-Count, I will get blank value for blank values.

4 Replies

    • pstanek's avatar
      pstanek
      Post Patron

      I tried this

      column = table1[number]/table2[pocet]

       

      Pocet=COUNTAX(table2;table2[name])

      , but it says that in direct query Countax can not be used.

  • v-caliao-msft's avatar
    v-caliao-msft
    Microsoft Employee

    Hi Pstnaek,

     

    You can add a calculated column to get the count number for each Name
    Count = CALCULATE(COUNT(CountValue[Number]),ALLEXCEPT(CountValue,CountValue[Name]))
    And then get the value Number i / Count( Name i)
    Number/Count = CountValue[Number]/CountValue[Count]

    To count blank value, you can use COUNTBLANK function
    CountBlank = COUNTBLANK(CountValue[Number])

     

    Regards,

    Charlie Liao

    • pstanek's avatar
      pstanek
      Post Patron

      Countblank does not work within DirectQuery, that is the problem