Power BI: matching the filter context

Sundar Iyengar

New Member
Joined
Nov 24, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have a table for two products, four rows for each. I dropped it into Power BI Desktop and created two visuals and one slicer. I am not able to attach the Power BI model to this post. Here is the underlying table and an image of the Power BI screen:
Product​
Filter 1Filter 2ComponentFilter 3Price
P1​
F21G81RxBolt
1​
0.26​
P1​
F21G17RxBolt
1​
0.34​
P1​
F21G81RxBolt
12​
1.26​
P1​
F21G17RxBolt
12​
1.47​
P2​
F21G81RxBolt
1​
1.27​
P2​
F21G17RxBolt
1​
1.72​
P2​
F21​
G81RxBolt
12​
2.03​
P2​
F21​
G17RxBolt
12​
2.91​

With 'Filter 3' set to 1, the matrix visual shows products P1 and P2 in the columns and a common component in the row, with the component price for each product. In a separate visual, right next to the first, a geomean is computed of the two columns.

geomean = calculate (geomean('TestTable'[Price]), ALLSELECTED('TestTable'[Product]))

For each 'Filter 3' value, there are two entries for each product. The matrix visual is set up to show only the max of the two.

I was expecting the geomean to calculate the geomean of only the two max values as they represent the filter context. However, it computes the geomean of all four values, two for each product.

Is there a way to change the geomean DAX formula to match the filter context and max value setting of the matrix visual?

Thanks
 

Attachments

  • PowerBI-Test.jpg
    PowerBI-Test.jpg
    139.7 KB · Views: 15

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top