- Home - Microsoft Power BI Community · Microsoft The Definitive Guide to DAX Business...

52

Transcript of - Home - Microsoft Power BI Community · Microsoft The Definitive Guide to DAX Business...

www.sqlbi.com

𝑘=0

𝑛𝐺𝑟𝑜𝑠𝑠𝑀𝑎𝑟𝑔𝑖𝑛

𝑆𝑎𝑙𝑒𝑠𝐴𝑚𝑜𝑢𝑛𝑡≠σ 𝐺𝑟𝑜𝑠𝑠𝑀𝑎𝑟𝑔𝑖𝑛

σ 𝑆𝑎𝑙𝑒𝑠𝐴𝑚𝑜𝑢𝑛𝑡

SUM (Orders[Price] * Orders[Quantity])

---- Computes the maximum of sales amount--

---- Compute the maximum between amount and listprice--

You can write it better with DIVIDE

SUMX (

FILTER (

Orders,

Orders[Price] > 1

),

Orders[Quantity] * Orders[Price]

)

SUMX (

ALL ( Orders ),

Orders[Quantity] * Orders[Price]

)

ALL ( Customers[CustomerName] )

Columns of the same table

ALL

ALLEXCEPT

Orders[City] not listed here

FILTER ALL

SUMX (

FILTER (

ALL( Orders ),

Orders[Channel]="Internet"

),

Orders[Amount]

)

ProductId Product

1 Coffee

2 Pasta

3 Tomato

Amount ProductId

25.00 1

12.50 2

2.25 3

2.50 3

14.00 4

Relationship

BLANK BLANK

Tables with an incoming relationship

might contain an additional blank

row, created by DAX to guarantee

referential integrity

---- Returns only the existing products--

RELATEDTABLE ( Product )

RELATEDTABLE ( Sales )

https://datainsightssummit.hubb.me/