Forum Discussion

Kathir's avatar
Kathir
Frequent Visitor
2 years ago
Solved

unique calculated column

Hi, 

 

What is the caculated DAX to achieve 1, 0 from the table below.?

 

It shld be used in data view calculated column and not a measure in a report

 

Thanks

  • Kathir 

    you can try to create an index column in PQ

     

    then use DAX to create a column

     

    Column =
    VAR _count=countx(FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])&&'Table'[Column1]=EARLIER('Table'[Column1])),'Table'[Column1])
    return if (_count=1,1,0)
     
     

     

     

     

2 Replies

  • Kathir 

    you can try to create an index column in PQ

     

    then use DAX to create a column

     

    Column =
    VAR _count=countx(FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])&&'Table'[Column1]=EARLIER('Table'[Column1])),'Table'[Column1])
    return if (_count=1,1,0)
     
     

     

     

     

  • NaveenGandhi's avatar
    NaveenGandhi
    Memorable Member

    Hi Kathir 

    Your question is a bit unclear, If you want a calculated column to only have unque values from the column you specified use below dax to create a table.

    Unieuq = values(columnname)

    If this is not what you are looking for, Please provide sample screenshot for sample output.

    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    Follow me on LinkedIn!!!