Forum Discussion

mihai_enache's avatar
mihai_enache
Frequent Visitor
5 years ago
Solved

Count with multiple criteria selection

Hello

 

I am rather new with Power BI and came across a situation I don't know how to resolve.

 

I have 2 tables: one with users which contains the user ID and 4 criteria 

User IDBudgetNeighbourhoodsNumber of roomsProximity to metro station
110000A, B, C, D1, 25 minutes
25000A, E, J, K115 minutes
33000B, C, D, E310 minutes
410000A, B, C, D, E3not important
511000A, E3, 4not important
67000A, B1, 2, 3, 410 minutes

 

 

And one with apartments 

 

Apartment IDPriceNeighbourhoodNumber of roomsProximity to metro station
19750A25 minutes
24000A410 minutes
32550E315 minutes
44550B310 minutes
57550C1out of range
66000A110 minutes

 

For each table, I need to create the 6th column:

  • in the User table, for each user, I want to see how many apartments suit him
User IDBudgetNeighbourhoodsNumber of roomsProximity to metro stationNumber of apartments according to criterias
110000A, B, C, D1, 25 minutes1 (apt 1,6)
25000A, E, J, K115 minutes0
33000B, C, D, E310 minutes0
410000A, B, C, D, E3not important2 (apt 3,4)
511000A, E3, 4not important2 (apt 2,3)
67000A, B1, 2, 3, 410 minutes3 (apt 2,4,6)
  • in the Apartment table, for each apartment, I want to see how many users are suited for them.
Apartment IDPriceNeighbourhoodNumber of roomsProximity to metro stationNumber of persons according to criterias
19750A25 minutes1 (user 1)
24000A410 minutes2 (users 5, 6)
32550E315 minutes2 (users 4,5)
44550B310 minutes2 (users 4,6)
57550C1out of range0
66000A110 minutes1 (user 6)

 

Some complexities:

  • in the user table, the neighborhoods and number of rooms are stacked (see table)
  • in the user table, the distance to metro is a maximum so if a user selected 15 minutes, all apartments at 5, 10 and 15 minutes are suited for him. For users who say is not important => they get all apartments. 
  • in the apartment table, if an apartment is out of range, he is suitable only to those users who say metro is not important

Thank you for your help

  • collinq's avatar
    collinq
    5 years ago

    HI mihai_enache ,

     

    Since you moved the question, can you mark this one as complete/solved so as to stop folks from checking on it in this location?  Thanks!

2 Replies