cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
snickell Frequent Visitor
Frequent Visitor

Adding columns from different tables based on date

I have two tables, one contains a price column, and one contains a volume column. I'd like to create a new table with both price and column. There is a date column in each of the original tables that I'd like to be the relationship between the price and column. So in the end I want a table with Date, Price, and Volume. How can I do this? 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Adding columns from different tables based on date

Hi @snickell ,

 

You can take try of “Merge” option in query edit.

Click “Merge Queries as New” to generate a new table under the condition of date matching:

1.png2.png3.png

 

Alternatively, you can using DAX :

Price = LOOKUPVALUE(Table1[Price],Table1[Date],Table2[Date])

4.png

 

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

Re: Adding columns from different tables based on date

So to be more specific, I'm in DAX and I've typed out a lot of summarized columns for a few different things, and I'm having trouble just simply adding a single column of values that correlate with the date. I was keeping it simple for explantions sake earlier, but now I can't seem to figure out how to add on that last column. Merge queries isn't an option at this point with the way the new table is set up. I think the Add Column tool will be the solution but I don't know how to get the prices to go right alongside everything else

Community Support Team
Community Support Team

Re: Adding columns from different tables based on date

Hi @snickell ,

 

Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

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

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 307 members 3,525 guests
Please welcome our newest community members: