Forum Discussion
Rank shows all 1
Hi all,
I have a trend bar chart that want to show "Exclude top 5". It will show all months that is ranked 5 and above based on total volume.
This is the DAX I used:
Hi kilala
Is DIM_TIME_PERIOD_SELECTED[Month_Year] custom sorted by another column? If so, you need to include that in your ALLSELECTED statement as well.
4 Replies
- cengizhanarslan
Super User
Try forcing the month context explicitly:
Top 5 Vol (Trend) = VAR CurMonth = SELECTEDVALUE ( DIM_TIME_PERIOD_SELECTED[Month_Year] ) RETURN RANKX ( ALLSELECTED ( DIM_TIME_PERIOD_SELECTED[Month_Year] ), CALCULATE ( [Volume Selected], KEEPFILTERS ( DIM_TIME_PERIOD_SELECTED[Month_Year] = CurMonth ) ), , DESC, Dense )Then to exclude the top 5, use this as a visual filter:
Show Month (Exclude Top 5) = IF ( [Top 5 Vol (Trend)] > 5, 1 )Put Show Month (Exclude Top 5) in the visual-level filters and keep only is 1.
- MichaelVenablesRegular Visitor
Hi Kilala,
you might need to use the ALLSELECTED function in your measure to break the local filter context of the x axis if you try the measure below.
Top 5 Vol (Trend) =
RANKX(
ALLSELECTED('DIM_TIME_PERIOD_SELECTED'[Month_Year]),
[Volume Selected],
,
DESC,
Dense
)
Then when you select your bar chart. drag the new meausre into the filters on this visual section and set the filter to is greater than 5.
Hopefully this helps.Michael