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
paris
Helper V
Helper V

Combining tables

Hi All,

 

I have price table (daily), forex table (monthly), calender table (daily and monthly) and want to create new table (daily and calculations).

 

My original data's date is in text format and wrong order (can not change as it is not my data) so I added amend daily and amenda month to clean up.

 

I tried crossjunction function to combine them but for some reason, all date mix up.

 

Please help!!!!

 

2020_03_13_bi.JPG

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@paris 

In price table create these columns

Amend Month = date(year([Amend Daily]),month([Amend Daily]),1)
Exchange = minx(filter(Forex,Froex[Amend Month]=Price[Amend Month]),Forex[AUD/USD])

Sales/USD = Price[Sales/AUD]*Price[Exchange]
Sales + 15 Percent margin = Price[Sales/USD]*1.15

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@paris 

In price table create these columns

Amend Month = date(year([Amend Daily]),month([Amend Daily]),1)
Exchange = minx(filter(Forex,Froex[Amend Month]=Price[Amend Month]),Forex[AUD/USD])

Sales/USD = Price[Sales/AUD]*Price[Exchange]
Sales + 15 Percent margin = Price[Sales/USD]*1.15

 

Hi Amitchandak,

 

Thank you very much for your help. I have never used minx & filter - they are such a powerful functions. Thank you again.

 

All the best,

Paris

 

Greg_Deckler
Super User
Super User

It is tough to say exactly without sample text data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

However, it seems like what you want is Merge Query in the Query Editor. This would be much more efficient than trying CROSSJOIN function in DAX. Although it is possible that you might have wanted to use NATURALINNERJOIN DAX function instead of CROSSJOIN.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

HI Greg Decler,

 

Thank you for your advice. I did not know I can post a table. It is such a useful infomation. Thank you!

 

All the best,

Paris

 

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.