Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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:
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:
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:
I hope PowerBI community could help me with this one. Thank you all in advance.
Solved! Go to Solution.
In this scenario, I think we can first create a new TOPN table for 2016. 2016 Topn Producer Eng will be in this table. Then create a measure to calculate the volumes for each Producer Eng in a specific year (which will be on the X-Axis). At last, drag this volumes measure into Value field, the column chart will always show the volumes of 2016 topn producer eng for each year.
Best Regards,
Herbert
In this scenario, you can first create a year column and then create a rank column (only rank volume for 2016 and return 1 for other years) in Volumes table with following formula.
Year = YEAR ( Volumes[Date] )
Rank = IF ( Volumes[Year] = YEAR ( TODAY () ), RANKX ( FILTER ( Volumes, Volumes[Year] = YEAR ( TODAY () ) ), Volumes[Volume], , DESC, DENSE ), 1 )
Drag Rank column into Visual level filters and select TopN as you wanted.
Best Regards,
Herbert
Thank you very much for your response! It was very helpful - now I understand how RANKX and FILTER work way better.
I apologise as I should've been clearer at describing my data and what am I trying to achieve here.
Let's say we have top5 in 2016: A B D C E
top5 in 2015: A C B F D
What i want is seeing top5 2016 development through the years, so in 2015 I also want to see A B D C E producers, regardless of what top5 in 2015 was.
And one more thing worth mentioning - Producer Eng isn't unique, it's inherited from Producers table, so if we are ranking entire volumes table as you proposed we get something looking like this:
which is wrong because i want to rank Producer Eng, not Producer.
I am not asking you for a solution, just for a hint, because i realise that it can be really time-consuming for you and that i should've describe my problem better.
Thank you in advance,
Bogdan
Could you please provide some more information like columns in your each table and relationship between tables?
Best Regards,
Herbert
Sure. Here are the relationships:
And there is a full list of "Volumes" table fields:
In this analysis I am also considering only the values where dimension = "mln l". Table GroupsVolume do not take any part in currently discussed visualizations.
Thank you in advance.
Best Regards,
Bogdan
In this scenario, I think we can first create a new TOPN table for 2016. 2016 Topn Producer Eng will be in this table. Then create a measure to calculate the volumes for each Producer Eng in a specific year (which will be on the X-Axis). At last, drag this volumes measure into Value field, the column chart will always show the volumes of 2016 topn producer eng for each year.
Best Regards,
Herbert
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |