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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

CALCULATETABLE Question

I am trying to wrap my head around why the following measure works the way I want it to, but not the way I would expect or can explain:

 

COUNTROWS(CALCULATETABLE(ClientInfo,ClientInfo[Client Number] <> VALUES(ClientInfo[Client Number])))

 

The context is that if I remove the line "ClientInfo[Client Number] <> VALUES(ClientInfo[Client Number])", I get the total number of rows in the ClientInfo table - lets say 100. When I add the line back to the measure and view the count without any slicers/filters within a report, I get an error because no single client is selected - that makes sense. If I select a single client number (ClientInfo[Client Number]) from a slicer/filter, I get a count of 99. However, If I then use another attribute of the ClientInfo table, for example "State," I get a row count that is equal to the number of clients within that state minus 1. With those same slicers in place (single client and single state selected) If I again redefine the measure and take out the "ClientInfo[Client Number] <> VALUES(ClientInfo[Client Number])" line, I get 1 - the measure would read: COUNTROWS(CALCULATETABLE(ClientInfo)).

 

I'm not sure why the measure as defined at the top of this post correctly returns the number of clients within a state, minus 1, when I select a single client and state. I have a theory as to why this works, but I should actually just call it a wild guess. Can anyone explain why this works the way it does?

 

Thanks,

 

Eric

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Having slept on it, I'm now wondering to myself why I didn't understand this. By leaving the "ClientInfo[Client Number] <> VALUES(ClientInfo[Client Number])" line in the measure, I'm resetting the filter on ClientInfo[ClientNumber] and getting a count of the rows where other slicer values are limiting the number of clients minus the currently selected client. 

 

Sleep...is there anything it can't do? (Said in your best Homer Simpson voice.)

 

Eric

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Having slept on it, I'm now wondering to myself why I didn't understand this. By leaving the "ClientInfo[Client Number] <> VALUES(ClientInfo[Client Number])" line in the measure, I'm resetting the filter on ClientInfo[ClientNumber] and getting a count of the rows where other slicer values are limiting the number of clients minus the currently selected client. 

 

Sleep...is there anything it can't do? (Said in your best Homer Simpson voice.)

 

Eric

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.