Power BI, ranking Stack Column Chart based on highest y-axis value (Qty) per x-axis (Day)

105 views Asked by At

I would like to check how it is possible for me to rank elements based on the highest Qty (y-axis) based on the latest day (x-axis) in a Stacked Column Chart in Power BI.

Sample chart is in the image here. Some information was censored for confidential reasons Sample Power BI Chart

With reference to the image, I would like to put the element with the highest quantity for the day on the top left hand corner, and then continue ranking in descending order. Apart from the 12 individual elements shown, there is another row of 6 below, making a total of 18 elements.

`Ranking =

VAR LatestDay = CALCULATE(MAX(Data[Year_Week]))

VAR TopX = TOPN(1, FILTER(Data, Data[Year_Week] = LatestDay), [WfrQty], DESC)

RETURN

RANKX(TopX, [WfrQty],, DESC)`

I did a DAX Code but was interrupted by shortfall of memory. I'm not sure how else I can fit the above requirements so please help me if possible... Thank you!

0

There are 0 answers