Forum Discussion

donbonbon's avatar
donbonbon
Frequent Visitor
8 years ago
Solved

Something wrong with calculated column (using filtering in it)

Hey,   I cannot figure out what is wrong with this formula Column = calculate(DISTINCTCOUNT('DB'[lead_id],FILTER('DB', 'DB'[status]="accepted")))   Thnx!
  • muchinski's avatar
    8 years ago

    Please, try the following:

    Column = calculate(DISTINCTCOUNT('DB'[lead_id]),'DB'[status]="accepted")

     

    Explanation: The second part for the CALCULATE is already the filter expression. You don't need to use FILTER in this case. In addition, DISTINCTCOUNT accepts only 1 parameter, so you need to close your parenthesis right after 'DB'[lead_id].

    EXTRA TIP: If you want this expression to consider also the other filters applied on you report, you can use the following:

    Column = calculate(DISTINCTCOUNT('DB'[lead_id]),KEEPFILTERS('DB'[status]="accepted"))