Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
CMOLINA
Frequent Visitor

How to create a Price Index (see image)

Hello Team, I have a problem to calculate the Index Price or calculate (divide) al Column_Value/ Select_Product_Value (same column in this case Price).

What is your suggest to Select the produc with Slicer (Producto_Base)  and calculate the Index Column (rest of the price products)

Example Index Price.png

 

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

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:

model.jpg

 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

res.gif

 

sample pbix file attached





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

CMOLINA
Frequent Visitor

WOW Excellent!!!

Rock Star!

View solution in original post

2 REPLIES 2
CMOLINA
Frequent Visitor

WOW Excellent!!!

Rock Star!

PaulDBrown
Community Champion
Community Champion

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:

model.jpg

 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

res.gif

 

sample pbix file attached





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.