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
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!

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.