Join with static table?

  • Join with static table?

    Posted by Unknown Member on February 12, 2018 at 11:07 pm
    • Peter Pan

      Member

      February 12, 2018 at 11:07 PM

      Hi all,
      I have 2 tables, one is Product & one is Month (12 months), how can I join 2 tables together? I mean add every month from table Month to table Product like picture bellow?

      thumbnail image

      Thanks for your help!

    • Audrey Abbey

      Member

      February 12, 2018 at 11:50 PM

      Hi Tung,

      These tables do not share a column.Ā 
      The results you show is called a Cartesian Product.Ā 
      In the code, we use a cross join to do that.Ā 

      DAX:
      https://msdn.microsoft.com/en-us/library/gg492168.aspx

      You can also add a Custom Column via Query Editor and add the query for one table as a column for the other.Ā 
      Or add a custom column to each table, and populate with the value 1. Then merge the tables on that column.Ā 

      I am sure there are a few other ways to achieve it…but that should get you started.Ā 

      Best,Ā 
      Audrey

      ——————————
      Audrey Abbey
      SR. BI Developer/Analyst
      New Seasons Market
      Portland OR
      ——————————
      ——————————————-

    • Peter Pan

      Member

      February 16, 2018 at 10:47 PM

      Thanks for your information, Abbey.——————————————-

    • Tara Prasad Gumansingh

      Member

      February 13, 2018 at 2:17 AM

      Hi Tung Pham,

      Just create a relationship between these two tables on No.(If possible change the Month No. to only No.)
      1 – While creating the report take the Month from Month table and the rest from other one.
      2 – If you want the same thing on Data table then you can pull it by using Lookup formula.

      ——————————
      Tara Prasad Gumansingh
      Data Analyst
      Bangalore
      ——————————
      ——————————————-

    • Bruce Montemayor

      Member

      February 13, 2018 at 5:06 AM

      Why do you want to? If you are wanting to count or sum by month, the ideal thing would be to add a date table to the model and relate it to sales and orders and any other table containing dates. Then you will be able to aggregate counts and sums by any date dimension from any table. 
      Thank You,
      Bruce Montemayor

      ——Original Message——

      Hi all,
      I have 2 tables, one is Product & one is Month (12 months), how can I join 2 tables together? I mean add every month from table Month to table Product like picture bellow?

      thumbnail image

      Thanks for your help!

    • William Rodriguez

      Member

      February 13, 2018 at 10:17 AM

      Greetings @TungĀ Pham :

      is correct. Below illustratesĀ her ?recommendation

      CrossJoin
      Thanks!
      William

      #DAX?

      ——————————
      William Rodriguez
      Business Analyst
      ——————————
      ——————————————-

    Unknown Member replied 7 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Join with static table?’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!