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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
v-teven
Regular Visitor

How to add rows based on values in other table?

Hi, I have two tables connected by the "attribute" field - which states the country, year, quarter and segment. One of the tables contains the "values" and these are unique entries by quarter and segment. The other table contains the "Measure" with multiple entries by quarter, month and day. My problem is that some quarters have no data in a spectific quarter, such as in this example: left table contains the measure, but misses attribute "Ireland-FY18-Q2-Corporate" because it has no entry (measure) for that specific country/time/segment; right table shows the missing entry. 
How can I "add" those missing rows? 

Capture.PNGCapture.2.PNG 

 

 

3 REPLIES 3
Anonymous
Not applicable

Lets name your tables as Table 1 ( with measures & row to be added) and Table 2 ( it has extra rows)

 

You can merge these tables in Power Query with Right outer join.

 

In Power Query -> Home -> Merge-> Merge Queries, Table1 as First table and Table 2 as 2nd table , join type is Right outer join.

Now, you will have the missing row, with null value in Measure field .

 

Thanks

Raj

Thanks for your reply. 

 

I want to avoid merging because the query of table 1 is too large and takes a long time to load. Also, I'm using it in the report for another tables with measures that are all connected. I think redoing everything again would give me more work than trying a different alternative.  Any alternative suggestion would be really appreciated. 

 

Thank you!

Anonymous
Not applicable

Hi @v-teven,

 

I think union function(dax) and Table.InsertRows(M query) will suitable for your requirement:
UNION Function (DAX)

Table.InsertRows

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors