Forum Discussion
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
Anonymous,
The formula is correct, but you need to create relationship first and use measure instead of calculated column.
3 Replies
- v-chuncz-msftCommunity Support
Anonymous,
The formula is correct, but you need to create relationship first and use measure instead of calculated column.
- AnonymousNot applicable
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
- v-chuncz-msftCommunity Support
Anonymous,
No, values in a calculated column are fixed. They are an immutable result for each row in the table.