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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
akarasick1
Frequent Visitor

Count all *other* records excluding current record; consider blank values

In the bottom visual below, you'll notice answers of "6", but I'm looking for an answer of "8". Below I describe the setup:

 

In my "Store" table, notice the empty values for Store Name

akarasick1_2-1594691781651.png

 

I am trying to count how many other stores there are when I look at one store name (middle visual). I'm trying to use the following measure:

Count of All Other Store =
var __selection = SELECTEDVALUE(Stores[Store Name])
var __table = FILTER(ALLSELECTED(Stores),Stores[Store Name]<>__selection)
return
COUNTROWS(__table)

 

akarasick1_3-1594691789814.png

 

 

Thanks!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@akarasick1 , do not use store name, Try to take store id and advantage of row context

calculate(count(Stores[Store_id]),filter(all(Stores), Stores[Store_id]<>max(Stores[Store_id])))

or

calculate(count(Stores[Store_id]),filter(all(Stores[Store_id]), Stores[Store_id]<>max(Stores[Store_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

2 REPLIES 2
amitchandak
Super User
Super User

@akarasick1 , do not use store name, Try to take store id and advantage of row context

calculate(count(Stores[Store_id]),filter(all(Stores), Stores[Store_id]<>max(Stores[Store_id])))

or

calculate(count(Stores[Store_id]),filter(all(Stores[Store_id]), Stores[Store_id]<>max(Stores[Store_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
AntrikshSharma
Super User
Super User

I am getting the correct count, Is there any other filter active on the report?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.