Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Distinct dax with condition

Hi,   I'm getting unique values using Distinct to avoid duplicate list but can I add one conditon from its data table? In the same table 'TOSS serivce PO_master - Append', there's another column '...
  • mdaatifraza5556's avatar
    1 year ago

    Hi Anonymous 

    Can you please try the below DAX?

     


    VAR FilteredTable = FILTER(
    'TOSS service PO_master - Append',
    'TOSS service PO_master - Append'[Contract Amount] <> 0
    )
    RETURN DISTINCT(SELECTCOLUMNS(FilteredTable, "Service No", 'TOSS service PO_master - Append'[service no]))

     


    If this answers your questions, kindly accept it as a solution.
    If you found this helpful, then give kudos.

  • mdaatifraza5556's avatar
    mdaatifraza5556
    1 year ago

    Hi Anonymous 

    As i have tried with sample dataset

    Dataset

    Service No.Contract Amount
    1015000
    1027000
    1030
    1013000
    1048000
    1022000
    1050
    10612000
    1074000
    1080
    1030
    1043000
    1095000

     

    I have written the same DAX, and it return the result
    Can you please recheck the DAX code you wrote?