Power Pivot/DAX 全球最受歡迎付費(fèi)課程 10.3 理解擴(kuò)展表

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.篩選條件順著表直接建立的關(guān)系傳遞,且只能是從【一】傳遞到【多】
比如,統(tǒng)計(jì)每個(gè)月有多少產(chǎn)生銷量的買家,會(huì)發(fā)現(xiàn)總計(jì)數(shù)字不等于月份相加。因?yàn)檫@里的“總計(jì)”是指沒有月份篩選所有不重復(fù)的買家。
10.2 Filter Context-calculate last day of sales for each month
The last day of sales=MAX(Sales[Date]) 每月有銷售額的最后一天使用MAX,因?yàn)槿掌诘牡讓邮菙?shù)字。
Calendar表和Sales表的【Date】建立關(guān)系,Calendar的篩選條件通過關(guān)系傳遞到Sales table,控制了Sales Table的【Date】列,度量值開始工作。
10.3 Concept of Expanded Table
??再次強(qiáng)調(diào):關(guān)系在篩選上下文中起傳遞篩選條件的作用
Expanded Tables:
? In DAX every table has an "expanded" version: includes every column of the original table在DAX看來每張表都有一個(gè)包含表本身的擴(kuò)展版本
?
Every column of the related table on the one side 【一對(duì)多關(guān)系】中的【一】表所有列
? One-to-many relationships.先建立一對(duì)多關(guān)系,才可以談擴(kuò)展表
? Relationships "transfer" a filter from the lookup table to the data table
? A better way: The filter, filters the expanded table. 在擴(kuò)展表上應(yīng)用了篩選條件
【理論層面理解】銷售表的擴(kuò)展版本就是把有層級(jí)關(guān)系的Product(含次表)/Customer/Calendar表都包括進(jìn)來
01:57-02:06 Sales表的擴(kuò)展概念

【Excel形式理解】只有Sales有與其它表均建立了聯(lián)系,淺灰色理解為拓展部分
比如從Customer表中取數(shù)字,那只會(huì)統(tǒng)計(jì)Customer表自身的數(shù)字,而沒有Sales的數(shù)據(jù)列
