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
terpsbmore
Helper I
Helper I

Merged Query Calcuation

Hello All,

 

I recently appended and merged several queries to aggregate the data that I need in a single query table. My issue is the new measures I created for the merged query are not correct. So here is what I did.

 

All data is excel based. I appended 2 excel files for years 2016 & 2017 because one of the files reached the row limit for excel and I need both excel files together show 2 years of data. The newly appended file has every record spanning the 2 years and each has a unique id. That worked just fine.

 

Next, I merged (Left Outer Join) a third excel query containing a subset of unique id's to the appended query in order to add a new column which corresponds to the unique id column of the appended query. The resulting query having all unique id's for 2 years and a subset of the unique ids.

 

Finally, I am using a measure on the second (merged) unique id column to count the unqiue id's however, my totals do not match what is in excel.

UniqeID Count = DISTINCTCOUNT('TableName'[Merged Unique ID Column])

 

Any help or advice is much appreciated.

 

1 ACCEPTED SOLUTION

@terpsbmore,

 

Alternatively, you may try to use LOOKUPVALUE Function to add a calculated column in DAX.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@terpsbmore,

 

A left outer join specifies that all rows from the left table not meeting the join condition are included in the result set, and output columns from the other table are set to NULL in addition to all rows returned by the inner join.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I used a full join with the same result, any suggestions?

@terpsbmore,

 

Alternatively, you may try to use LOOKUPVALUE Function to add a calculated column in DAX.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Not sure why I didn't think of that. Geez....Thank you!

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.