Forum Discussion
TOP N Last Month Filter
Hi,
I have a line chart that has too much lines and I need to filter it so it gets more clear.
The chart is basically the amount variation % month by month of each contact reason along the last 6 months. But there is too much reasons, so the chart gets poluted.
I'll use one different filter inside each measures (there are 2 measures) so that I can use it as Field parameters. This makes the "Top N" filter not a option. One of them consider the amount of the last month and the other the total of the last 6 months.
In the first chart (field parameter) I want to show the amount % variation month by month, showing only the TOP 5 reasons (based on the last completed month, so, if we are in september, I want to filter the top 5 [total amount] from august).
In the second is the same thing but considering the total amount for each reason.
| MONTH | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| SEGUNDA VIA TITULAR | 13837 | 11178 | 12526 | 11421 | 11477 | 13173 | 9473 |
| ALTERACAO CADASTRAL | 11171 | 8990 | 9311 | 8255 | 8367 | 9001 | 6302 |
| CONSULTA SALDO | 7377 | 7240 | 8462 | 8303 | 6888 | 6638 | 4676 |
| DETALHAMENTO DE FATURA | 8206 | 7241 | 6931 | 6026 | 5799 | 5890 | 4164 |
| SEGUNDA VIA FATURA | 4819 | 3899 | 4293 | 4646 | 4030 | 4629 | 4103 |
| PARCELAMENTO | 9795 | 7426 | 7428 | 6568 | 5988 | 6077 | 3892 |
| PAGAMENTO | 7990 | 6060 | 6874 | 5489 | 4928 | 4956 | 3572 |
| CARTAO | 8330 | 5822 | 6896 | 5617 | 7002 | 5609 | 3460 |
| RESET/CADASTRO DE SENHA | 9227 | 6638 | 6266 | 5903 | 6971 | 6352 | 3367 |
| FATURA | 7529 | 6010 | 5583 | 5467 | 4715 | 5159 | 2855 |
| ALTERACAO DE LIMITE | 5368 | 4761 | 4610 | 3881 | 3569 | 4122 | 2851 |
So the first solution should show on the chart only the lines from the BLUE BOLD reasons. The second should consider the top 5 amount of all months.
Thanks a lot in advance
2 Replies
- v-xiaotangCommunity Support
Hi Anonymous
Thanks for reaching out to us.
>> So the first solution should show on the chart only the lines from the BLUE BOLD reasons
My suggestion is you can create a filter measure and put it into visual-level filter, for example,
filter measure 1= if(min('table'[column]) in {"SEGUNDA VIA TITULAR","ALTERACAO CADASTRAL","CONSULTA SALDO","PARCELAMENTO","RESET/CADASTRO DE SENHA"} ,1,0 )
then set visual-level filter to 1.
>> I want to show the amount % variation month by month
please read if this article helps, Month over Month Calculation in Power BI using DAX Month over Month Calculation in Power BI using DAX - RADACAD
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hello Tang. Thanks a lot for the reply, but this way it wont work because I need the reasons to be dynamic. Those are just the example of this data for the month 8.
The month over month calculation I know how to do. My problem is just how to filter the top X.
Best regards,
Raoni