Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I'm very new to PowerBi and am experiencing the following issue
User | License |
User 1 | Finance |
User 1 | Sales |
User 2 | Field Service |
User 2 | Finance |
User 2 | Customer Service |
User 3 | Finance |
User 3 | Sales |
User 4 | Finance |
User 5 | Finance |
Purchase Order | User |
PO1 | User 1 |
PO2 | User 1 |
PO3 | User 2 |
PO4 | User 2 |
PO5 | User 2 |
PO6 | User 3 |
PO7 | User 3 |
PO8 | User 5 |
PO9 | User 5 |
Solved! Go to Solution.
Hi @RubySmith ,
As mentioned by @collinq many to many relationships are generally avoided as much as possible and I have created a new table consisting of users and modified the relationship like this.
Coming to your main issue, Power BI is filtering out user4 because they don’t have any purchase order, if you do want to see the visual count of 0 for user4 we have to use a Dax command
“CountQuantity =
COALESCE(COUNT(Sheet2[Purchase Order]), 0)
“
With this method we will be able to view the count of user4. We can remove the count of purchase order from our columns but I have included it just to show the difference.
Read more about coalesce here: COALESCE function (DAX) - DAX | Microsoft Learn
Please consider Accepting the solution if the provided answer meets your requirement so as to help other users or get back to us if you have further queries.
Thanks and Regards
Hi @RubySmith ,
We have not heard back from you if any of the answers has met your requirement kindly Accept it as the solution to help out other community members or get back to us with any other questions.
Thank you
Hi @RubySmith ,
As mentioned by @v-nmadadi-msft , be aware always you can from many-to-many relationships.
For your scenario, you need to create a third table that will be related for table1 and table2 by this DAX:
Users = DISTINCT(UNION(VALUES(Table1[User]), VALUES(Table2[User])))
Above DAX will return This table:
Relate this table to both Table 1 and Table 2:
Now create a measure with the following DAX:
Count of Purchase Orders =
CALCULATE(
COALESCE(
COUNT(Table2[Purchase Order]),
0
),
FILTER(
Table1,
Table1[License] = "Finance"
)
)
Now create a Matrix visual, and drop the user column from the created users table in rows field, and on the values field add the created Count of Purchase Orders measure, and your Matrix will look like this:
Hi @RubySmith ,
As mentioned by @collinq many to many relationships are generally avoided as much as possible and I have created a new table consisting of users and modified the relationship like this.
Coming to your main issue, Power BI is filtering out user4 because they don’t have any purchase order, if you do want to see the visual count of 0 for user4 we have to use a Dax command
“CountQuantity =
COALESCE(COUNT(Sheet2[Purchase Order]), 0)
“
With this method we will be able to view the count of user4. We can remove the count of purchase order from our columns but I have included it just to show the difference.
Read more about coalesce here: COALESCE function (DAX) - DAX | Microsoft Learn
Please consider Accepting the solution if the provided answer meets your requirement so as to help other users or get back to us if you have further queries.
Thanks and Regards
Thanks that worked! appreciate your assistance
Hi @RubySmith ,
While it is possible and sometimes necessary to have a many-to-many relationship this is not common and can cause it's own unique issues - including odd results like blanks (or zero) being removed. Since you mentioned that you are new, Iwould suggest some light reading (lol) in this article: Many-to-many relationship guidance - Power BI | Microsoft Learn
Particularly review the grain level issues where data can be "removed" or ignored or lost.
If there is any way to get around the many-to-many (like a bridge table) then I prefer that method. Again, I understand in some cases there is no way around it but you have to be very careful about many-to-many relationships.
Proud to be a Datanaut!
Private message me for consulting or training needs.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
75 | |
54 | |
38 | |
31 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |