Denormalizing Table Data

  • Denormalizing Table Data

    Posted by Robert Jolliffe on February 28, 2020 at 10:45 am
    • Robert Jolliffe

      Member

      February 28, 2020 at 10:45 AM

      Hi Everyone,

      Sorry if this has been asked and answered, I may be searching on the wrong keywords.

      I have 3 tables that look like this:

      TABLE DATA
      IDĀ  Ā NAME
      1Ā  Ā  Ā JO
      2Ā  Ā  Ā SUE

      TABLE CUSTOM_FIELD_DATA
      DATA_IDĀ  Ā FIELD_IDĀ  Ā DATA
      1Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  1Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  SMITH
      1Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  2Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  33
      2Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  1Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  JONES
      2Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  2Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  22

      TABLE CUSTOM_FIELDS
      IDĀ  Ā  Ā  Ā  NAME
      1Ā  Ā  Ā  Ā  Ā  LAST_NAME
      2Ā  Ā  Ā  Ā  Ā  AGE

      I want to create a query that looks like this
      QUERY DATA
      IDĀ  Ā  Ā NAMEĀ  Ā  LAST_NAMEĀ  Ā  AGE
      1Ā  Ā  Ā  Ā JOĀ  Ā  Ā  Ā  Ā  SMITHĀ  Ā  Ā  Ā  Ā  Ā  Ā  33
      2Ā  Ā  Ā  Ā SUEĀ  Ā  Ā  Ā JONESĀ  Ā  Ā  Ā  Ā  Ā  Ā  22

      Any ideas?Ā  I am fairly new to Power BI – old hand at SQL,Ā  In SQL I’d probably make the LAST_NAME and AGE fields sub-queries.Ā  There are about 3-5 of these fields out of 20 or so.

      Thanks very much

      ——————————
      Robert Jolliffe
      President, Sabre Limited
      Cambridge
      5195857524
      ——————————

    • Vishesh Jain

      Member

      March 2, 2020 at 4:02 AM

      Hi ,

      Please have a look at the attached file.

      I have merged all 3 queries into one, removed the unnecessary columns and pivoted a column, which you can see step by step in the query transformation.?

      The query is named Merge1.

      The same can be achieved by using the RELATED() DAX function in the table view, but from a performance perspective its better that its done in Power Query.

      Hope this solves your problem.

      Thank you,

      ——————————
      Vishesh Jain
      Owner
      VR Construction
      ——————————
      ——————————————-

    Robert Jolliffe replied 6 years, 1 month ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Denormalizing Table Data’ 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!