Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Count differents values with condition

Hi, I need a help to create a colunm in DAX.   The colunm "How many different hour" need to count how many different hours I have per "Type", for example:  Type A have 2 different hours (20:20:53 ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  Anonymous ,

     

    Here are the steps you can follow:

    1. Create calculated column.

     

    Flag = 
    var _table1=
    SUMMARIZE('Table','Table'[Type],'Table'[Hour])
    return
    COUNTX(
        FILTER(_table1,
        [Type]=EARLIER('Table'[Type])),[Hour])
    

     

    2. Result:

     

     

    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