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.
Hi there,
I have two tables : Policies and Quotes. In both tables is a column called [Product]
I want to create a dimension table holding distinct values of [Product] from both Policies and Quotes tables.
I want to do this in m query, not Dax.
Please help with the syntax!
Solved! Go to Solution.
Solved! Just stick a Table.Distinct in front of the Table.Combine query and add an additional close parameter at the end of the query:
= Table.Distinct(Table.Combine({Table.FromColumns({Policies[Product]}, {"Product"}), Table.FromColumns ({Quotes[Product]}, {"Product"})}))
I got this:
= Table.Combine({Table.FromColumns({Policies[Product]}, {"Product"}), Table.FromColumns ({Quotes[Product]}, {"Product"})})
But it doesn't create a distinct list
Solved! Just stick a Table.Distinct in front of the Table.Combine query and add an additional close parameter at the end of the query:
= Table.Distinct(Table.Combine({Table.FromColumns({Policies[Product]}, {"Product"}), Table.FromColumns ({Quotes[Product]}, {"Product"})}))
Hi @JemmaD ,
you can do this pretty easily via the graphical interface in Power Query.
1. Append the two tables as new tables
2. Remove all columns except [Product]
3. Remove duplicates from the column [Product]
This would be the M code
let
Source = Table.Combine({Policies, Quotes}),
#"Removed Other Columns" = Table.SelectColumns(Source,{"Product"}),
#"Removed Duplicates" = Table.Distinct(#"Removed Other Columns")
in
#"Removed Duplicates"
Apparently there is a way to select the Product column within the Table.Combine argument, I just can't get the syntax right.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |