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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mp390988
Post Patron
Post Patron

Customer count not showing correctly

This is my model.

mp390988_0-1741731801248.png

 

I am trying to show a visual that shows the customer count per year so I created a measure called count of customers which is defined as belows. The reason why I am using crossfilter is because if you look at my model, there is no direct relationship between DimDate and DimCustomer. Also, the model shows that the filters from DimCustomer do not propagate into DimDate.

 

 

count of customers = CALCULATE(
    COUNTROWS(DimCustomer),
    CROSSFILTER(FactInternetSales[OrderDateKey],DimDate[DateKey],Both)
)

 

mp390988_1-1741731920941.png

As you can see, I keep getting repeated values of 18484.

What am I doing wrong here?
You can find the pbix file here 


3 ACCEPTED SOLUTIONS
Deku
Super User
Super User

You can use the expanded table context to get the answer

 

count of customers =

Countrows(

Summarize( FactInternetSales,  DimCustomer[customer key]

)

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

... or you can let the data model do that work for you

 

lbendlin_0-1741734749623.png

 

View solution in original post

The crossfilter should of be on sales <-> customer rather than date. Filters travel in the directions of the arrow, in your model the relationship is customer -> sales, so the filter cannot travel to customer as the arrow is pointing the wrong way.

 

The simpliest thing was to do a distinctcount( sales[customerId] ) then you don't have to bother travelling from the sales table. Would only be worth it if you wanted to count a attribute that was in the customer table


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

7 REPLIES 7
mp390988
Post Patron
Post Patron

Just for my understanding, any particular reason why the cross filter method shows repeating total against calender year? Is there anything wrong with this method?

The crossfilter should of be on sales <-> customer rather than date. Filters travel in the directions of the arrow, in your model the relationship is customer -> sales, so the filter cannot travel to customer as the arrow is pointing the wrong way.

 

The simpliest thing was to do a distinctcount( sales[customerId] ) then you don't have to bother travelling from the sales table. Would only be worth it if you wanted to count a attribute that was in the customer table


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1741750959679.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Deku
Super User
Super User

You can use the expanded table context to get the answer

 

count of customers =

Countrows(

Summarize( FactInternetSales,  DimCustomer[customer key]

)

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

... or you can let the data model do that work for you

 

lbendlin_0-1741734749623.png

 

mp390988
Post Patron
Post Patron

Apologies.

Does the link work now?

lbendlin
Super User
Super User

Link requires access, please check.

 

Bidirectional filters are another way of saying "cartesian product". They are almost never the answer.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors