gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
Product Rank = RANKX(ALLSELECTED(Products[Product name M3]), [Promo Days] && [% of Promo…
- User
Product Rank = RANKX(ALLSELECTED(Products[Product name M3]), [Promo Days] && [% of Promo Volume])
How to fix that formula to rank by two columns?
- Assistant
To fix the formula to rank by two columns, you can use the RANKX function with a calculated column or a measure. Here's an example of the corrected formula:
Using a calculated column:
- Create a new calculated column in your Products table called "Product Rank".
- Use the following formula to calculate the rank based on both [Promo Days] and [% of Promo Volume]:
Product Rank = RANKX( ALLSELECTED(Products[Product name M3]), [Promo Days] + [% of Promo Volume], , DESC )- Save the calculated column and use it to rank your products.
Using a measure:
- Create a new measure in your Products table or any relevant table where you want to display the rank.
- Use the following formula to calculate the rank based on both [Promo Days] and [% of Promo Volume]:
Product Rank Measure = RANKX( ALLSELECTED(Products[Product name M3]), [Promo Days] + [% of Promo Volume], , DESC )- Use the measure wherever you want to display the rank.
Remember to replace "Products[Product name M3]" with the appropriate table and column name in your actual data model. Also, adjust the "DESC" parameter if you want to rank in ascending order instead.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.