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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Newbie_1
Frequent Visitor

Dynamically calculating an index with a fixed value based on selection criteria

Hi there, 

I am doing a pricing analysis in EUR/L, and I would like to calculate to do an indexation of all products within a certain category where the base value for all products should always be the EUR/L price for the product with the highest % market share or top volume rank. 

Please refer to the below table:
- EUR/L comes from the data table

- % Market share is from the data table

- For volume rank I use the following measure : RANKX(ALLSELECTED('EUR/L Overview'),CALCULATE(SUM('RSP Overview'[Volumes])))

- The intention for "EUR/L for product with highest market share" in this case, is supposed to generate 55.64 across all rows in the table, so that I am eventually able to do the indexation. I have been trying various DAX calculations with 'FILTER', 'MAX', 'CALCULATE' but it's either going against the system logic with true/false expressions, or generates the below output (the EUR/L for the respective product). Any suggestions how I can achieve the desired result?

Newbie_1_1-1729650043443.png

 

Much appreciate any help

1 REPLY 1
bhanu_gautam
Super User
Super User

@Newbie_1 , Try usinge below DAX

 

Calculate the EUR/L for the product with the highest market share:

HighestMarketShareEUR_L =
CALCULATE(
MAX('EUR/L Overview'[EUR/L]),
FILTER(
'EUR/L Overview',
'EUR/L Overview'[% Market Share] = MAXX(ALL('EUR/L Overview'), 'EUR/L Overview'[% Market Share])
)
)


Calculate the EUR/L for the product with the top volume rank:
TopVolumeRankEUR_L =
CALCULATE(
MAX('EUR/L Overview'[EUR/L]),
FILTER(
'EUR/L Overview',
RANKX(ALLSELECTED('EUR/L Overview'), CALCULATE(SUM('RSP Overview'[Volumes]))) = 1
)
)


Choose the appropriate EUR/L value based on your criteria (highest market share or top volume rank):
BaseEUR_L =
IF(
[Use Market Share],
[HighestMarketShareEUR_L],
[TopVolumeRankEUR_L]
)


Create the indexation measure:
IndexedEUR_L =
DIVIDE(
'EUR/L Overview'[EUR/L],
[BaseEUR_L]
)

[Use Market Share] is a boolean measure or parameter that you can set to determine whether to use the highest market share or the top volume rank for the base EUR/L value.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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