Power Pivot/DAX 全球最受欢迎付费课程 10.3 理解扩展表

10.1-10.3 筛选上下文 拓展表
10.1 Filter Context-relationships&grand total
🌟Filter "transfer" from the one side of the relationship to the many side. Not the other way round.筛选条件顺着表直接建立的关系传递,且只能是从【一】传递到【多】
比如,统计每个月有多少产生销量的买家,会发现总计数字不等于月份相加。因为这里的“总计”是指没有月份筛选所有不重复的买家。
10.2 Filter Context-calculate last day of sales for each month
The last day of sales=MAX(Sales[Date]) 每月有销售额的最后一天使用MAX,因为日期的底层是数字。
Calendar表和Sales表的【Date】建立关系,Calendar的筛选条件通过关系传递到Sales table,控制了Sales Table的【Date】列,度量值开始工作。
10.3 Concept of Expanded Table
🌟再次强调:关系在筛选上下文中起传递筛选条件的作用
Expanded Tables:
• In DAX every table has an "expanded" version: includes every column of the original table在DAX看来每张表都有一个包含表本身的扩展版本
➕
Every column of the related table on the one side 【一对多关系】中的【一】表所有列
• One-to-many relationships.先建立一对多关系,才可以谈扩展表
• Relationships "transfer" a filter from the lookup table to the data table
• A better way: The filter, filters the expanded table. 在扩展表上应用了筛选条件
【理论层面理解】销售表的扩展版本就是把有层级关系的Product(含次表)/Customer/Calendar表都包括进来
01:57-02:06 Sales表的扩展概念

【Excel形式理解】只有Sales有与其它表均建立了联系,浅灰色理解为拓展部分
比如从Customer表中取数字,那只会统计Customer表自身的数字,而没有Sales的数据列
