Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Setting up static TopN filter

$
0
0

Hello everyone!

 

I have standard transactions table and a date table. Transactions table contains info on various producers and their output. I created a simple measure to calculate their average prices which i am intending to visualize using a bar chart:

Graph sample.PNG

 

Currently I have a Visual filter which shows only Selected TopN (3,5,7,10) producers in terms of output (Volumes[Volume] column). The problem is that it calculates ranks for TopN producers in each year separately. What I am trying to achieve is showing only this year (2016 atm) TopN. Here is what I have so far:

  1.  Ranking measure:      RanksForAvg = RANKX(ALL(Volumes[Producer Eng]); CALCULATE(SUM(Volumes[Volume]); FILTER(ALL(Dates[Year]); Dates[Year]=YEAR(NOW()))); ;DESC;Dense)

where Volumes[Producer Eng] is just Producer's name

     2. Visual filter measure: FiltForAvg = IF([RanksForAvg]<=[Selected TopN];1;0)

 

Both work just fine as standalone visualizations, but when I try to add visual filter it behaves really odd, filtering nothing:

Graph2.PNG

 

 

I hope PowerBI community could help me with this one. Thank you all in advance.


Viewing all articles
Browse latest Browse all 213819

Trending Articles