DAX
Share
Explore
Avec relation dans le modèle

icon picker
CROSSFILTER

Cf. exemple : .
Product Category 1 → oo Product SubCategory 1 → oo Product 1 → oo Sales
Dans une matrice qui affiche le Product Name et la somme des Sales Amount, on ajoute la Product Category :
image.png
Retourne la “Category” d’un produit :
IF (
NOT EMPTY ( Sales ),
CALCULATE(
SELECTEDVALUE ( 'Product Category'[Category] ),
CROSSFILTER (
'Product'[ProductSubcategoryKey],
'Product Subcategory'[ProductSubcategoryKey],
BOTH
),
CROSSFILTER (
'Product Subcategory'[ProductCategoryKey],
'Product Category'[ProductCategoryKey],
BOTH
)
)
)
ou plus simplement (cette dernière syntaxe peut présenter des effets indésirables sur des modèles plus complexes) :
Product Category exp.table =
CALCULATE (
SELECTEDVALUE ( 'Product Category'[Category] ),
'Product'
)


Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.