Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

10 REPLIES 10
Tahreem24
Super User
Super User

@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))
Capture.PNG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

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

@Anonymous ,

So just switch total off from table property.

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

can you please explain why you did minus 2 in the second measure

@PoweeeBII ,

Sorry for the typo. It was equal sign not minus.

Measure2 = CALCULATE(SUM('Table'[Id]),FILTER('Table',[Measure 1]=2))
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Please check again, i am not getting any values

also i see the case you have taken, you  have already removed Id 2

Anonymous
Not applicable

I see whats wrong, my version is of text type and not integer, and so is the Id, how do i handle that?

amitchandak
Super User
Super User

@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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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
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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.