Introduction to DAX in Power BI
Jess Ahmet
Content Developer, DataCamp
Calculated Column
Calculated Column
Item | Price | Tax | Price_with_tax |
---|---|---|---|
A | $ 20 | 25% | $25 |
B | $ 45 | 0% | $45 |
C | $ 100 | 15% | $115 |
Measures
X
after the function name i.e SUMX()
SUMX(<table>, <expression>)
Measures
X
after the function name i.e SUMX()
SUMX(<table>, <expression>)
Item | Price | Tax | Price_with_tax |
---|---|---|---|
A | $ 20 | 25% | $25 |
B | $ 45 | 0% | $45 |
Measures
X
after the function name i.e 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]))
Filter context is a set of filters that have been applied before the calculation is carried out.
Filter context can be applied in several ways:
Filter context is a set of filters that have been applied before the calculation is carried out.
Example:
Color | Quantity |
---|---|
Blue | 1,250 |
Green | 200 |
Black | 4,000 |
Filter context is a set of filters that have been applied before the calculation is carried out.
Example:
Color | Quantity |
---|---|
Blue | 1,250 |
Filter context is a set of filters that have been applied before the calculation is carried out.
Example:
Color | Quantity |
---|---|
Blue | 1,250 |
Green | 200 |
Black | 4,000 |
Filter context is a set of filters that have been applied before the calculation is carried out.
Example:
Socks | Shoes | T-shirt | |
---|---|---|---|
Blue | 200 | 800 | 250 |
Green | 90 | 10 | 100 |
Black | 2,000 | 800 | 1,200 |
Filter context is a set of filters that have been applied before the calculation is carried out.
Example:
Socks | |
---|---|
Blue | 200 |
CALCULATE(<expression>[, <filter1> [, <filter2> [, …]]])
Sales[City]="London"
, Sales[Country] <> "United Kingdom"
CALCULATE()
filters will always override filters from the visualizationCALCULATE(SUM(Sales), Sales[Region]="EMEA")
Introduction to DAX in Power BI