Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Easy Dax solution required

I have a table like this below and I would Like to get only those Ids which has both the version present in Version column. So in below table I would like to get list of IDs or count of Ids which has both version 1 and 2 in here it will be ID 1 and 3. Thanks in Advance!!

 

IdVersion
11
12
21
31
32
  • @PoweeeBII, create a measure like the following and use with id in visual

    medida :
    var _max 2
    devolución
    countx(filter(summarize(Table, Table[Id], "_1",distinctcount(table[Version])),[_1] ?_max),[Id])

10 Replies

  • @PoweeeBII, create a measure like the following and use with id in visual

    medida :
    var _max 2
    devolución
    countx(filter(summarize(Table, Table[Id], "_1",distinctcount(table[Version])),[_1] ?_max),[Id])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Cant I have this as a new column and pass true and false and then do the count. The issue I am seeing here is What if I have version 3 and then i need to check for Ids which has all the 3 version

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak your solution works fine, but my question if my version increases like there are 3 versions possible for any ids and i would like to get ids with all versions, i will write var max= 3 and so on..but instead of hardcodiing if i go fo var max= distinctcount(table1[version]) it does not return the desired result..thogh the value is 2 if i check it seperately for distinctcount(table1[version]) . any clue what is wrong here?? i mean it doesnt seems to be binding with Ids when using in a matrix while with a hard coded value it works fine

  • Anonymous ,

    You can make it happen by creating 2 measures:

    Measure 1 = CALCULATE(COUNT('Table'[Version]),ALLEXCEPT('Table','Table'[Id]))
    Measure2 = CALCULATE(SUM('Table'[Id]),FILTER('Table',[Measure 1]=2))
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      What is 8 here? I dont need to sum my Ids, i need the list of Ids who has both version

      • Tahreem24's avatar
        Tahreem24
        Super User

        Anonymous ,

        So just switch total off from table property.