cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tanaka
Frequent Visitor

Losing values using one sided columns

Hello,

I have two tables like this.
Table A

TYPEPRODUCTVALUE ADATEKEY
TYPE 1PRODUCT A 1001/10/2021(TYPE+PRODUCT+DATE)
TYPE 2PRODUCT A 2001/10/2021 (TYPE+PRODUCT+DATE)
TYPE 3PRODUCT B3001/10/2021 (TYPE+PRODUCT+DATE)


Table B

TYPEPRODUCTSTYLEVALUE BDATEKEY
TYPE 1PRODUCT A STYLE 150001/10/2021(TYPE+PRODUCT+DATE)
TYPE 2PRODUCT A STYLE 150001/10/2021(TYPE+PRODUCT+DATE)
TYPE 3PRODUCT BSTYLE 2100001/10/2021(TYPE+PRODUCT+DATE)


I connect them by the Key column making a one-to-many relation.
In a matrix i have Date as line values, VALUE A and VALUE B as values, when filtering by product i have the max value in the total line, e.g. filtering PRODUCT A, i get 30 in VALUE A Total, and 1000 in VALUE B Total, but...

When filtering this matrix by STYLE, VALUE A lose values, and VALUE B keeps the Total Value.

I tried use ALLEXCEPT in order to calculate VALUE A. Tried to merge tables. 

I know the error occurs because some STYLEs doesnt have VALUE A, so thats why i lose some values.

Any ideas?

Regards.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Working with tables related like this is bound to be challenging. I'd recommend taking a step back and trying to set up a cleaner star schema model with dimension tables set up so that you don't have composite keys for relationships.

 

 

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

Working with tables related like this is bound to be challenging. I'd recommend taking a step back and trying to set up a cleaner star schema model with dimension tables set up so that you don't have composite keys for relationships.

 

 

I have these 2 tables, and created a FactTable, but still using composite keys to link them.

When filtering by a column that exists in both tables i got these values.

Tanaka_0-1633547534356.png

When filtering by a single sided column i got these

Tanaka_2-1633548032867.png
I read the article that you shared, but can't imagine a better way to solve this.

 




Ideally, you'd probably want separate dimension tables for Type, Product, and Date. It's hard to make good recommendations without seeing a sample .pbix file though.

Well, thank you anyway.

I'll leave this in stand by, maybe in the near future i try again.



Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!