Power BI 的 DAX 入門
Jess Ahmet
Content Developer, DataCamp
計算欄
計算欄
| Item | Price | Tax | Price_with_tax |
|---|---|---|---|
| A | $ 20 | 25% | $25 |
| B | $ 45 | 0% | $45 |
| C | $ 100 | 15% | $115 |
量值
X,如 SUMX()SUMX(<table>, <expression>)量值
X,如 SUMX() SUMX(<table>, <expression>) | Item | Price | Tax | Price_with_tax |
|---|---|---|---|
| A | $ 20 | 25% | $25 |
| B | $ 45 | 0% | $45 |
量值
X,如 SUMX() SUMX(<table>, <expression>) | Item | Price | Tax | Price_w_tax |
|---|---|---|---|
| A | $ 20 | 25% | $25 |
| B | $ 45 | 0% | $45 |
| Total | - | - | $ 70 |
SUMX(Sales, Sales[Price] + (Sales[Price] * Sales[Tax]))篩選脈絡是指在執行計算前已套用的一組篩選條件。
可以用多種方式套用篩選脈絡:
篩選脈絡是指在執行計算前已套用的一組篩選條件。
範例:
| Color | Quantity |
|---|---|
| Blue | 1,250 |
| Green | 200 |
| Black | 4,000 |
篩選脈絡是指在執行計算前已套用的一組篩選條件。
範例:
| Color | Quantity |
|---|---|
| Blue | 1,250 |
篩選脈絡是指在執行計算前已套用的一組篩選條件。
範例:
| Color | Quantity |
|---|---|
| Blue | 1,250 |
| Green | 200 |
| Black | 4,000 |
篩選脈絡是指在執行計算前已套用的一組篩選條件。
範例:
| Socks | Shoes | T-shirt | |
|---|---|---|---|
| Blue | 200 | 800 | 250 |
| Green | 90 | 10 | 100 |
| Black | 2,000 | 800 | 1,200 |
篩選脈絡是指在執行計算前已套用的一組篩選條件。
範例:
| Socks | |
|---|---|
| Blue | 200 |
CALCULATE(<expression>[, <filter1> [, <filter2> [, …]]])Sales[City]="London", Sales[Country] <> "United Kingdom"CALCULATE() 的篩選會覆寫視覺物件上的篩選CALCULATE(SUM(Sales), Sales[Region]="EMEA")Power BI 的 DAX 入門