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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nilsvarmon
Regular Visitor

Dax measure not showing correct values in table where Dim rows don't exist in Fact Table

I have two tables, DimUser and FactOrders. I would like to count the Nbr of Users which is a measure in my Dim table "Nbr of Users". It works fine in the first table even though the first User don't exist in the Fact table. However, when I drag in a column from the Fact table (Location- kind of the same as Location from DimUser) the first User loses the vlaue 1, but the Total still display 3. Why doesn't it show 1 with a BLANK in "Orders" and "Location (From Fact)"?

 

Power BI Issue.PNG

1 ACCEPTED SOLUTION

Hi @nilsvarmon ,

I updated the sample pbix file(see attachment), please check whether that is what you want.

expected result.JPG

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @nilsvarmon ,

Are the table DimUser and "Nbr of Users" same table? Or they are totally different? Could you please share the relationship among these tables(DimUser, "Nbr of Users" and FactOrders) in order to provide you a suitable solution? Also provide the forumla of measure [Nbr of Users]. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi!

Here are the definitions of the measures:

 

Nbr of Users = DISTINCTCOUNT('DimUsers'[UserID])

Nbr of Orders = DISTINCTCOUNT('FactOrders'[OrderID])

 

Here is the relationship:

nilsvarmon_0-1607942364561.png

 

 

In the end result I would like to show that "Malmö" also has 1 user attached to it, but with no corresponding rows in FactOrders:

 

nilsvarmon_1-1607942561344.png

It's when I use the column "Location" from FactOrders that the problem occurs.

 

 

 

Hi @nilsvarmon ,

I created a sample pbix (see the attachment) for you, please check whether that is what you want.

1. Set the relationship direction as single between table DimUsers and FactOrders

Set single direction relationship.jpg

2. Create another new measure to replace measure [Nbr of Users]

Measure = SUMX(VALUES('DimUsers'[Location]),[Nbr of Users])

create another measure.JPG

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi!

This solution partly works, thank you! The measure with SUMX seems to work, but how come I see "Goteborg" the in Location column to the right. UserID=4630163 has no rows in the Fact, so it should be Blank in that cell, right?

nilsvarmon_0-1608020571219.png

 

And when I slice on that User, it looks strange, it shows twice which it shouldn't do.

 

nilsvarmon_1-1608020741849.png

 

 

Hi @nilsvarmon ,

I updated the sample pbix file(see attachment), please check whether that is what you want.

expected result.JPG

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.