使用一个带有两个不同表和两个不同数据列的切片机(日期)
我的数据模型中有几个表。
其中,我有“销售”表
- (包含按客户、日期和营销来源列出的所有已售产品)和“媒体支出”表
- (包含所有营销来源及其每月预算)。
表“销售”
产品 | 合同 ID | 客户 ID | 销售日期 | 来源
A | 001 | C1 | dd.mm.yyyy hh.mm.ss | 来源 A
B | 002 | dd.mm.yyyy hh.mm.ss | 来源 B
B | dd.mm.yyyy hh.mm.ss |
C | 004 | C3 | 来源 C
D | C6 | 来源 F
“媒体支出”
来源 | 活动月份
来源 A | mm.yyyy
B | 600 €
来源 C | 300 € | mm.yyyy
来源 E |
mm.yyyy
来源 F | mm.yyyy |
表格
应 通过关系“来源”连接。提到“销售日期”比“营销活动月份”更详细(dd.mm.yyyy hh.mm.ss) (mm.yyyy)。
这使我可以按“来源”过滤客户和营销预算。 但同时我想按日期计算/过滤(例如“销售日期”)。 但这是不可能的。
如何继续关联不同表中的两个不同列?
我已经尝试过以下
基于两个日期列构建关系 =>问题从日期转移到源
为“销售日期”和“营销活动”月份列创建的第二个连接(“源”除外)。 =>数据模型将连接显示为虚线。否则没有效果。
谢谢!
I have several tables in my data model.
Among others I have the table
- "Sales" (with all sold products by customer, date and marketing source) and the table
- "Media Spend" (with all marketing sources and their budget per month).
TABLE "SALES“
Product | Contract ID | Customer ID | Sales Date | Source
A | 001 | C1 | dd.mm.yyyy hh.mm.ss | Source A
B | 002 | C2 | dd.mm.yyyy hh.mm.ss | Source B
B | 003 | C1 | dd.mm.yyyy hh.mm.ss | Source B
C | 004 | C3 | dd.mm.yyyy hh.mm.ss | Source C
D | 005 | C6 | dd.mm.yyyy hh.mm.ss | Source F
TABLE „MEDIA SPEND“
Source | Spend | Campaign Month
Source A | 500 € | mm.yyyy
Source B | 600 € | mm.yyyy
Source C | 300 € | mm.yyyy
Source D | 100 € | mm.yyyy
Source E | 550 € | mm.yyyy
Source F | 1,000 € | mm.yyyy |
The tables are connected by the relation "Source".
It should be mentioned that the "Sales Date" is much more detailed (dd.mm.yyyy hh.mm.ss) than the "Campaign month") (mm.yyyy).
This allows me to filter both customers and marketing budgets by "Source".
But at the same time I want to calculate / filter by Date (e.g. „Sales date“).
But this is not possible.
How can I proceed to relate the two different columns in different tables?
I have already tried the following
Build the Relation based on both Date-Columns
=> Problem shift from Date to Source
Second connection (besides "Source") created for the columns "Sales Date" and "Campaign" month.
=> The data model shows the connection as dashed. Otherwise there is no effect.
THANX!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如下所示,您可以通过在Power BI中选择新表来创建一个日期表:
< img src =“ https://i.sstatic.net/gzesb.png” alt =“ new Table”>
复制并粘贴以下和粘贴日期表,您的日期表将被
创建
:以下结果:
创建此表之后,您可以使用以下DAX为每列创建其他列:
添加这些列后,您的结果将如下所示:
You can create a dates table by selecting New Table when you're in Power BI as can be seen below:
Copy and paste the below and your dates table will be created:
or
Both of which will provide you with the below result:
After creating this table, you can create additional columns using the following dax for each column:
After adding these columns, your result will look like this: