Forum Discussion
How to create a Price Index (see image)
- 4 years ago
Here is one way. Set up the model with a dimension table (recommended) and an independent table for product (you will be using this independent product table for the slicer). The model looks like this:
Set up the table visual using the field from the Product table; the slicer from the 'Select Product' table.
Then these measures:
Price = DIVIDE(SUM(fTable[Venta]), SUM(fTable[Unidades]))and
Index = VAR _Selected = CALCULATE ( [Price], FILTER ( ALL ( 'Product Table' ), 'Product Table'[dProducto] = SELECTEDVALUE ( 'Select Product'[Producto Sel] ) ) ) RETURN DIVIDE ( [Price], _Selected )and you will get
sample pbix file attached
- 4 years ago
WOW Excellent!!!
Rock Star!
Here is one way. Set up the model with a dimension table (recommended) and an independent table for product (you will be using this independent product table for the slicer). The model looks like this:
Set up the table visual using the field from the Product table; the slicer from the 'Select Product' table.
Then these measures:
Price =
DIVIDE(SUM(fTable[Venta]), SUM(fTable[Unidades]))
and
Index =
VAR _Selected =
CALCULATE (
[Price],
FILTER (
ALL ( 'Product Table' ),
'Product Table'[dProducto] = SELECTEDVALUE ( 'Select Product'[Producto Sel] )
)
)
RETURN
DIVIDE ( [Price], _Selected )
and you will get
sample pbix file attached