Forum Discussion
Using CALCULATE and ALL yielding unexpected results
This seems like it should be easy, but my calculate function isn't yielding the results I'm looking for so maybe I'm just misunderstanding it's general usage. I have a dataset that looks like this:
Pkup Date is coming from a date table, Prod No is coming from a Producer table, Mnfst No is coming from a Manifest table, and Pkup Lbs is just a simple sum function. I wanted to add a column that would list the total Pkup Lbs for a producer, so I attempted to use this formula:
Hi esuing ,
We can try to use the following measure to meet your requirement:
All Lbs = IF([Pkup Lbs] <= 0, BLANK(), CALCULATE([Pkup Lbs],all(Manifests[Mnfst No])))
Best regards,
4 Replies
- esuing
Helper I
Thanks, Marcus... so how can I change my measure so that only the Mnfst No are returned that are related to the data from the other fields (like shown in the first screenshot)? I can put in a visual filter for Pkup Lbs > 0, but the performance is still horrid (takes minutes to resolve). Seems like there should be a way to only bring back the valid records.
- v-lid-msft
Community Support
Hi esuing ,
We can try to use the following measure to meet your requirement:
All Lbs = IF([Pkup Lbs] <= 0, BLANK(), CALCULATE([Pkup Lbs],all(Manifests[Mnfst No])))
Best regards,