简体   繁体   中英

Performing an Inner Join in Power BI

I'm currently having an issue displaying data in Power BI, this data is being retrieved from a star schema. Let's say I want to display data from 2 dimensions in one table of power BI, as you will see here, It looked like the power BI would be doing a wrong inner join.

在此处输入图片说明

The First two columns (Prac_Number and ProjectTitle) come from a table A and the column "Name" from a table B, these two tables are connected trough another table C (which would be the fact table).

to prove that what the power BI is doing, is wrong, I tried the following query with SQL Server:

SELECT DISTINCT ph.ID as [PRAC_Number], ph.ProjectTitle, phs.Name

FROM pracHeader ph JOIN pracDetails pd ON ph.ID = pd.HeaderID 
                    JOIN pracHeaderStatus phs ON phs.ID = ph.StatusID

ORDER BY ph.ID

and it worked out pretty well as you can check see here:

在此处输入图片说明

In other words, I just want to achieve this ^ in power BI. So if I have to create a custom column or something like that, where should I create it?, in which table?... Because the data is not matching correctly. Thanks in advance!

Reviewing the PowerBI output and your expected results, it looks like you might be missing (or something might not be correct with) the relationship configuration inside the PowerBI data model. PowerBI appears to just be listing the contents of each dimension table because it doesn't know how to relate the two. It could be helpful to see how you have your PowerBI relationships defined.

PowerBI Relationship Pane

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM