Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

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.

 

MONTH3456789
SEGUNDA VIA TITULAR13837  11178  12526  11421  11477  13173  9473  
ALTERACAO CADASTRAL11171899093118255836790016302
CONSULTA SALDO7377724084628303688866384676
DETALHAMENTO DE FATURA8206724169316026579958904164
SEGUNDA VIA FATURA4819389942934646403046294103
PARCELAMENTO9795742674286568598860773892
PAGAMENTO7990606068745489492849563572
CARTAO8330582268965617700256093460
RESET/CADASTRO DE SENHA9227663862665903697163523367
FATURA7529601055835467471551592855
ALTERACAO DE LIMITE5368476146103881356941222851

 

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-xiaotang's avatar
    v-xiaotang
    Community 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.

    • Anonymous's avatar
      Anonymous
      Not 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