Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Multiple filters in 1 visual

Hi there,

 

I have a chart in which I want two different filters in 1 chart.

Chart 1 has a filter on Stats IN (3,4,5), while chart 2 has a filter on Status IN (1,2).

However: the last column in chart 2 must multiply the 'Uren per wens' values from chart 1 by the 'Aantal wensen' values from chart 2.

How can this be achieved? The values in the last column of chart 2 are always filtered in Status IN (1,2) and that's not what I want.

4 Replies

  • Anonymous , In this I think measure filter will be better

     

    Like

    calculate([Antel Wensen], filter(Table, Table[Stats] IN (3,4,5))) //Measure for Table 1

    calculate([Antel Wensen], filter(Table, Table[Stats] IN (1,2))) //Measure for Table 2

     

    Now to get the over all values

    calculate([Antel Wensen], filter(allselected(Table), Table[Stats] IN (3,4,5))) // overall with all selected

     

    calculate([Antel Wensen], filter(all(Table), Table[Stats] IN (3,4,5)))  // ignore all flter

     

    Now the last one can be used every if use set of visual by separated   by slicer using interactions

    https://docs.microsoft.com/en-us/power-bi/create-reports/service-reports-visual-interactions

     

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Amitchandak! But for some reaso I cannot select all colums in my measure.
      I can only select other measures.

      This is probably a beginners mistake or misunderstanding but it limits me at this time.

      Can you explain why I cannot select values other than measures?

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous - You will need to use something like ALL or ALLEXCEPT to break out of filter context. However, the specifics are unclear to me as I do not know if "Aantal wensen" and "Uren per wens" are measures or columns or what kind of aggregation you are using if columns for example. If columns and using a SUM aggregation, then something like this might work:

    Measure =
      VAR __num1 = SUM([Uren per wens])
      VAR __Categorie = MAX([Categorie])
      VAR __num2 = CALCULATE(SUM([Uren per wens]),FILTER(ALL('Table'),[Categorie]=__Categorie && [Status] IN { 3, 4, 5 }))
    RETURN
      __num1 * __num2
    

    But overall, Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

     

     

     

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    >>However: the last column in chart 2 must multiply the 'Uren per wens' values from chart 1 by the 'Aantal wensen' values from chart 2.

     

    I am not sure what desired result would you want, could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

     

    Please read this post to get your answer quickly: How to Get Your Question Answered Quickly.

     

    Best Regards,

    Amy