[英]new Power BI table combining unrelated data
I am trying to create a table that is a list of all possible combinations between two tables: products and companies.我正在尝试创建一个表,该表是两个表之间所有可能组合的列表:产品和公司。 I'm building a dashboard in Power BI and the data comes from SQL queries.
我正在 Power BI 中构建仪表板,数据来自 SQL 查询。 I have the following list structures for the Products table and the Companies table:
对于 Products 表和 Companies 表,我有以下列表结构:
and my desired output for analysis is:而我想要分析的 output 是:
There is nothing that relates the companies to the products, and I'm trying to get a list of all of the products for each company.没有任何东西将公司与产品联系起来,我正在尝试获取每家公司的所有产品列表。 Can I do this in Power BI?
我可以在 Power BI 中执行此操作吗? If not, is it possible in SQL (there is nothing to join on)?
如果没有,是否可以在 SQL 中(没有什么可以加入)? Thank you for your help!
谢谢您的帮助!
You can do this with a 'hacked' join, or a cross join.您可以使用“被黑”连接或交叉连接来执行此操作。 I prefer the former from a process POV, but cannot speak to speed or efficiency.
我从流程 POV 中更喜欢前者,但不能谈论速度或效率。
I think this 'cross join' is only technically right and does not provide future flexibility.我认为这种“交叉连接”仅在技术上是正确的,并不能提供未来的灵活性。
Both methods will get you to the same end point, and can be done in SQL or PQ.这两种方法都会让您到达相同的终点,并且可以在 SQL 或 PQ 中完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.