cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mweschenburg
Regular 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

Accepted Solutions
Community Support
Community Support

Re: DAX help with PRODUCT function and filter

@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
Community Support
Community Support

Re: DAX help with PRODUCT function and filter

@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

mweschenburg
Regular Visitor

Re: DAX help with PRODUCT function and filter

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

Community Support
Community Support

Re: DAX help with PRODUCT function and filter

@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
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors