Forum Discussion

vnqtrang's avatar
vnqtrang
Helper I
4 years ago
Solved

Distinctcount with filter compare the values

Hi , I have the table below :    True/FALSE Server Name CODE True 110.200.1999, 22.333.222 AA EE000QQ0001 True 110.200.1999 BB EE000QQ0002 True 110.200.199...
  • marveling's avatar
    4 years ago

    Hi, 

     

    I think you can use this:

     

     

     

    DistinctCount =
    CALCULATE (
        DISTINCTCOUNT ( 'TableA'[Name] ),
        REMOVEFILTERS (),
        SUMMARIZE ( TableA, 'TableA'[Server], 'TableA'[CODE] ),
        'TableA'[True/FALSE] = "True"
    )

     

     

    Let me know if it works.

     

    Thanks,

    M

     

    If this post helps, please consider Accepting it as the solution to help other members find it more quickly.

     

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  vnqtrang ,

    Here are the steps you can follow:

    1. Create calculated column.

    column =
    IF(
        'Table'[True/FALSE]="True",
    CALCULATE(
        DISTINCTCOUNT('Table'[Name]),
        FILTER(ALL('Table'),
        'Table'[True/FALSE]="True"&&'Table'[Server]=EARLIER('Table'[Server])&&
        'Table'[CODE]=EARLIER('Table'[CODE]))))

    2. Result:

    If you need pbix, please click here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly