Forum Discussion
DAX function returns blank in card
Running chassis matching with F =
VAR __overallMax = [Overall max pallet positions per 3hr bucket]
VAR __maxPalletOccuredBucket =
FILTER (
VALUES ( 'Time Buckets'[Bucket] ),
[New Pallet requirement] = __overallMax
)
RETURN
__maxPalletOccuredBucketYou can try the above but since I can't see the model, don't know the measures used and don't really know what the code does in the context you try to use it in, I can't be of more help. FILTER should return one value. If it returns more, then you'll get an error.
Best
Darek
- vissvess7 years ago
Helper V
Dear Anonymous ,
The code worked great. As mentioned by you. There is a one time occurance of the max value. So the code doesnot returned an error.
But could you please clarify, what to do if I get an error in future as the dataset may get updated, so that there are two field values with the max. What to do to get the any one or latest or both in the list that to be used for slicer.
Please extend your kind help further.
Thanks
- Anonymous7 years agoNot applicableIf you get 2+ time buckets, then you have to decide what rule you want to apply to get one of them as the value of your measure. It's your choice. I can't help you with this. All I can do is try to figure out how to implement rules and algorithms. I can't create them for you.
Best
Darek- vissvess7 years ago
Helper V
Hi Anonymous ,
You are correct. The logic should be mine. I need the max value with latest date.
Kindly suggest to improve the code.
Thanks
VissVess