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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ImprintGroup
Regular Visitor

Duplicate rows when bringing data from multiple tables

Hello,

I am very new to Power BI and I am building my first report. I'm having an issue where I'm getting multiple rows of values that relate to a single record. It's hard to describe the problem so I'm going to show it as best I can. The data source is an SQL database hosted in Azure. 

 

Table 1 contains top level accounts. Table 2 contains client programs associated with the accounts. Table 3 contains individual events associated with each program from Table 2. Table 4 contains the financials for the program and are linked to Table 2 and not Table 3.

 

Looking at my screenshot you'll see the bottom 6 rows are for the same account and the same program. But there are 6 events associated with the program. 

 

1. how can I get the Account Name column and Program Name column to only show one instance of the account and program names and not show it in each row for each EventName? I'd rather those be blank.

1. Same question for the financials. You'll see $43,673 listed 6 times, one for each different EventName. But the financial number is attached to the ProgramName. So I'd like the financial to show just once for the ProgramName and not each time there is an EventName associated with the program.

 

I've been banging my head against my desk for the better part of 2 days trying different things I find via search engines. But they either don't work or I don't fully understand how to implement.

 

Untitled - Power BI Desktop 2022-04-19 at 3.49.46 PM.jpeg

 

Thank you very much!

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

HI @ImprintGroup ,

Based on your current description, it is caused by the fact that you have a 1-to-many relationship between your table and the table before it. Just like in database, using left join to query two tables, if the fields in table 1 have more than one corresponding value in table 2, this will happen. Your current view is that there should be multiple correspondences between table 3 and other tables.
Also, according to your description, you only want to display one data in table 3, you can generate a new table based on table 3, and then create a relationship with the new table.

 

Sample:

tableA:

vluwangmsft_0-1651040039912.png

tableB:

vluwangmsft_1-1651040061766.png

relationship:

vluwangmsft_3-1651040255002.png

Output:

vluwangmsft_4-1651040277144.png

 

 

Step1,cancel relationship:

vluwangmsft_5-1651040304649.png

Step 2, add index on the tableB:

vluwangmsft_6-1651040452032.png

 

Step 3, base on table B ,create new tableC:

rank1 = RANKX(FILTER(TableB,TableB[index]=EARLIER(TableB[index])),TableB[Index.1],,ASC,Dense)

vluwangmsft_7-1651040721673.pngvluwangmsft_8-1651040877063.png

Step4 ,create relationship ,and new visual:

vluwangmsft_9-1651040902116.png

vluwangmsft_10-1651041000243.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

6 REPLIES 6
v-luwang-msft
Community Support
Community Support

HI @ImprintGroup ,

Based on your current description, it is caused by the fact that you have a 1-to-many relationship between your table and the table before it. Just like in database, using left join to query two tables, if the fields in table 1 have more than one corresponding value in table 2, this will happen. Your current view is that there should be multiple correspondences between table 3 and other tables.
Also, according to your description, you only want to display one data in table 3, you can generate a new table based on table 3, and then create a relationship with the new table.

 

Sample:

tableA:

vluwangmsft_0-1651040039912.png

tableB:

vluwangmsft_1-1651040061766.png

relationship:

vluwangmsft_3-1651040255002.png

Output:

vluwangmsft_4-1651040277144.png

 

 

Step1,cancel relationship:

vluwangmsft_5-1651040304649.png

Step 2, add index on the tableB:

vluwangmsft_6-1651040452032.png

 

Step 3, base on table B ,create new tableC:

rank1 = RANKX(FILTER(TableB,TableB[index]=EARLIER(TableB[index])),TableB[Index.1],,ASC,Dense)

vluwangmsft_7-1651040721673.pngvluwangmsft_8-1651040877063.png

Step4 ,create relationship ,and new visual:

vluwangmsft_9-1651040902116.png

vluwangmsft_10-1651041000243.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

AllisonKennedy
Super User
Super User

@ImprintGroup  this is the difference between using the 'matrix' visual in Power BI and the 'table' visual. Use a 'matrix' visual and you will get blanks for repeated program.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy 

I'm trying to use the Matrix visual now. While I struggle with not being able to visually represent each data point across the row in columns, as I add the financials I still end up with repeating amounts for each line where there is an event.

Untitled - Power BI Desktop 2022-04-19 at 4.48.25 PM.jpeg

@ImprintGroup You can turn stepped layout off under options, then need to play with formatting: 

 

AllisonKennedy_0-1650422611314.png

 

 

As for your repeated values, do you want it blank? 

 

Try using ISINSCOPE in a measure:

 

New Value = IF ( ISINSCOPE( table[event], BLANK(), SUM(table[value]) ) 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy This has me closer. But I can only see 8 out of about 16 "columns". I'm unable to scroll horizontally. 

 

I would prefer the repeated values be blank and I'll see what I can accomplish with your suggestion on the measure.

ImprintGroup
Regular Visitor

I tried Remove Duplicates in Power Query but it had no effect.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.