Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mweschenburg
Frequent Visitor

DAX help with PRODUCT function and filter

Hi,

 

Not sure why I am stumbling on this.  I have 3 tables (Antenna, Endpoint and EndpointAntenna).  I want to create a calculated column in Endpoint that is a product of rows in EndpointAntenna, filtered by an Antenna slicer.

 

Sample of data is shown below.  ProductOfErrorRate is the calculated column which should take on the blue highlighted values based upon a user selecting one or both antennas in a slicer.

 

I started with this, which gives be the "A and B" value, but ignores the antenna slicer.

 

     =CALCULATE(PRODUCT('EndpointAntenna'[ErrorRate]))

 

Then I tried adding a filter, but it also ignores the antenna slicer.

 

     =CALCULATE(PRODUCT('EndpointAntenna'[ErrorRate]), ALLSELECTED('Antenna'))

     =CALCULATE(PRODUCT('EndpointAntenna'[ErrorRate]), ALLSELECTED('Antenna'[AntennaID]))

 

I think the filter is probably getting applied after the PRODUCT() calculation.  So I went through many versions of PRODUCT(), PRODUCTX(), FILTER(), and other uglier variations.  What am I missing?

 

Thanks, Micahel

 

Data.png

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@mweschenburg,

 

The formula is correct, but you need to create relationship first and use measure instead of calculated column.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@mweschenburg,

 

The formula is correct, but you need to create relationship first and use measure instead of calculated column.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks V.

 

I did get the calculated measure to work.  Your reminder about the relation caused me to review my model and I deactivated a rogue bi-directional filter that was messing with me.

 

Is there any possible way to get same to work as a calculated column in the Endpoint table?  I have other downstream columns and measures derived from the product calculation.

 

Michael

@mweschenburg,

 

No, values in a calculated column are fixed. They are an immutable result for each row in the table.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors