Forum Discussion

sman's avatar
sman
Frequent Visitor
2 years ago
Solved

Apply filter based on value in other table and compute average

Hi!

I have two tables. Sales and Stores:

 

 

 

I've connected the tables through the "Store" columns, and I've added a slicer that let's the user filter on the store. Now, I want to create a measure named "Region Average" that shows the average of averages of Amt over the stores that are in the region of the selected workshop. So for example, if a user selects store "1", the region is in "X" (with stores 1 and 2). Store 1 has an average Amt of 20, and store 2 has an average amt of 15. Thus I want to display the average of these, which is 17.5.

  • Try the below measure.

     

     

    Avg_New = CALCULATE(AVERAGE('Table'[Avg]),ALL('Table'[Store]))

     

     

     

    Best regards,

    Ismail | MiTutorials

    🎥 MiTutorials on YouTube

    Explore over 200+ Power BI tutorials and enhance your skills!

5 Replies

  • Try the below measure.

     

     

    Avg_New = CALCULATE(AVERAGE('Table'[Avg]),ALL('Table'[Store]))

     

     

     

    Best regards,

    Ismail | MiTutorials

    🎥 MiTutorials on YouTube

    Explore over 200+ Power BI tutorials and enhance your skills!

    • sman's avatar
      sman
      Frequent Visitor

      Hi Ismail,

       

      Won't this just the take average amount over all regions?

      • miTutorials's avatar
        miTutorials
        Icon for Super User rankSuper User

        If you have the region field on the table, it will not. Do give it a try and let me know if this does not work! We can then tweak the code.