Forum Discussion

quickwin's avatar
quickwin
Regular Visitor
9 years ago
Solved

Count ignores relationship

Hi,

I have users table and cities table with relationship 1-many based on city ID (one city can have many users)

I wanted to have each city the number of assigned users. For that I have created a new column to the Cities table:

Users per city = COUNT('users'[Userid])

As a result, it shows for all cities the same number, which is the total number ALL users disregarding the relationship.

I'm probably missing something the way PBI behaves, and would appreciate any assistant.

10x

  • Lets cool dude , Try this one 

     

     

    Calculate ( COUNT('users'[Userid])) 

     

     

    Let me know if it is not helping u .

     

     

3 Replies

  • Baskar's avatar
    Baskar
    Icon for Resident Rockstar rankResident Rockstar

    Lets cool dude , Try this one 

     

     

    Calculate ( COUNT('users'[Userid])) 

     

     

    Let me know if it is not helping u .