Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
EladAppelNN
Frequent Visitor

Create new query based on parameters

Hi, Lets say I have a table/query for products, and a table/query for countries

 

query1         |                  query2

Product        |                 Countries

-Tomato       |                  - US

-Onion         |                 - UK

-Pepper        |                 - Germany

 

I want to create a new table/query that will be a database;

 

query3 - NEW

Product    Countries

Tomato     US

Tomato     UK

Tomato     Germany

Onion       US

Onion       UK

Onion       Germany

Pepper      US

Pepper      UK

Pepper      Germany

 

is there a dax formula to create query3?

3 REPLIES 3
sendilc
Frequent Visitor

Hi, 

 

Pls create 2 tables Products and Countries and then use the below PQ

 

let
Source = Product,
#"Added Custom" = Table.AddColumn(Source, "Custom", each Countries),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Countries"}, {"Countries"})
in
#"Expanded Custom"

 

Regards

 

Thanks for the detailed explanation, where should this be enterred? asa  new custom column?

m_dekorte
Resident Rockstar
Resident Rockstar

Hi @EladAppelNN,

 

Sure you could create that table with DAX, see here. 

m_dekorte_0-1683213530198.png

 

However if you're bringing your data in and loading that into Power Query, it makes more sense to create it there. To process is really simple. Go to your Products (query1), select Add Custom column

In the dialog box enter the Countries (query2) name, press OK

You'll see a nested table in the new column and with those sideward arrows in the header you can extract fields.

 

Ps. If this helps solve your query please mark this post as Solution, thanks!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors