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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
russelsss
Regular Visitor

Calculating indices using values in the same column

Hi everyone,

I have created a measure that divides 2 different variables and called it "price per pack"

(Price per pack =
DIVIDE(
 SUM('Value'[Value (in 1000 RUR)]),
 SUM('Volume'[Volume (in mln STICKS)])
)*20/1000

This measure filters price per pack at different levels (e.g. brand, price catgory etc.). So if I don't use any filters, then it shows a weighted average price of the entire category.

I am now trying to calculate price indeces of individual filters (e.g. brands, pricing catergories etc.) in relation to the weighted average price of the entire category.

Would be grateful for any advise.

Russel

2 ACCEPTED SOLUTIONS
Stachu
Community Champion
Community Champion

to be honest I don't get why you use Brand and Price Segment in ALLEXCEPT, what's the goal there? I thought you want to compare particular level with the total category? My original formula woud do that

Other than that you can put multiple fields in single ALLEXCEPT, e.g.
ALLEXCEPT(Value,Value'[BRAND],Value'[PRICE SEGMENT])
but I don't get why you want to do that



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

I wanted to see indices of individual brands vs total category, correct. I've figured out how to do that. Here's the formula that I've used:

WAP = DIVIDE([Price per pack], CALCULATE([Price per pack], all(Brand[BRAND])
))

Thanks for the inspiration!

View solution in original post

4 REPLIES 4
Stachu
Community Champion
Community Champion

try this code, you will have to adjust the blue syntax

Measure =
DIVIDE ( [Price per pack], CALCULATE ( [Price per pack], ( ALLEXCEPT ( 'Table', 'Table'[Category] ) ) ) )

 

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Thanks for the reply.

After creating this measure, I created a matrix with brands in rows, time periods in columns and the measure in values. But they don't match the manual calculation in Excel. Do you know what could be the reason?

Below is how I've constructed the measure.

Measure = DIVIDE([Price per pack], CALCULATE([Price per pack], ALLEXCEPT('Value','Value'[BRAND]), ALLEXCEPT('Value','Value'[BRAND]),ALLEXCEPT('Value','Value'[PRICE SEGMENT]
))).

Stachu
Community Champion
Community Champion

to be honest I don't get why you use Brand and Price Segment in ALLEXCEPT, what's the goal there? I thought you want to compare particular level with the total category? My original formula woud do that

Other than that you can put multiple fields in single ALLEXCEPT, e.g.
ALLEXCEPT(Value,Value'[BRAND],Value'[PRICE SEGMENT])
but I don't get why you want to do that



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

I wanted to see indices of individual brands vs total category, correct. I've figured out how to do that. Here's the formula that I've used:

WAP = DIVIDE([Price per pack], CALCULATE([Price per pack], all(Brand[BRAND])
))

Thanks for the inspiration!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.