Forum Discussion
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 ID | Budget | Neighbourhoods | Number of rooms | Proximity to metro station |
| 1 | 10000 | A, B, C, D | 1, 2 | 5 minutes |
| 2 | 5000 | A, E, J, K | 1 | 15 minutes |
| 3 | 3000 | B, C, D, E | 3 | 10 minutes |
| 4 | 10000 | A, B, C, D, E | 3 | not important |
| 5 | 11000 | A, E | 3, 4 | not important |
| 6 | 7000 | A, B | 1, 2, 3, 4 | 10 minutes |
And one with apartments
| Apartment ID | Price | Neighbourhood | Number of rooms | Proximity to metro station |
| 1 | 9750 | A | 2 | 5 minutes |
| 2 | 4000 | A | 4 | 10 minutes |
| 3 | 2550 | E | 3 | 15 minutes |
| 4 | 4550 | B | 3 | 10 minutes |
| 5 | 7550 | C | 1 | out of range |
| 6 | 6000 | A | 1 | 10 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 ID | Budget | Neighbourhoods | Number of rooms | Proximity to metro station | Number of apartments according to criterias |
| 1 | 10000 | A, B, C, D | 1, 2 | 5 minutes | 1 (apt 1,6) |
| 2 | 5000 | A, E, J, K | 1 | 15 minutes | 0 |
| 3 | 3000 | B, C, D, E | 3 | 10 minutes | 0 |
| 4 | 10000 | A, B, C, D, E | 3 | not important | 2 (apt 3,4) |
| 5 | 11000 | A, E | 3, 4 | not important | 2 (apt 2,3) |
| 6 | 7000 | A, B | 1, 2, 3, 4 | 10 minutes | 3 (apt 2,4,6) |
- in the Apartment table, for each apartment, I want to see how many users are suited for them.
| Apartment ID | Price | Neighbourhood | Number of rooms | Proximity to metro station | Number of persons according to criterias |
| 1 | 9750 | A | 2 | 5 minutes | 1 (user 1) |
| 2 | 4000 | A | 4 | 10 minutes | 2 (users 5, 6) |
| 3 | 2550 | E | 3 | 15 minutes | 2 (users 4,5) |
| 4 | 4550 | B | 3 | 10 minutes | 2 (users 4,6) |
| 5 | 7550 | C | 1 | out of range | 0 |
| 6 | 6000 | A | 1 | 10 minutes | 1 (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
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
- mihai_enacheFrequent Visitor
I think I put the question in the wrong section of the forum. I've created another post here: https://community.powerbi.com/t5/Desktop/Count-with-multiple-criteria/m-p/1560716
Sorry about that
- collinqSuper User
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!