Forum Discussion
vissvess
Helper V
7 years agoDAX function returns blank in card
Hi, Could anyone please clarify why the following measure returns "Blank". Running chassis matching with F = VAR overallmax = [Overall max pallet positions per 3hr bucket] VAR maxpalletoccu...
vissvess
Helper V
7 years agoDear 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
Anonymous
7 years agoNot applicable
If 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
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
- Anonymous7 years agoNot applicable
Maybe this could work? I'm not sure since I don't know all the details of the model.
Running chassis matching with F = VAR __overallMax = [Overall max pallet positions per 3hr bucket] VAR __maxDate = MAXX ( FILTER ( VALUES ( 'Calendar'[Date] ), [Max Pallet positions per day] = overallmax ), 'Calendar'[Date] ) VAR __maxPalletOccuredBucket = CALCULATE( VALUES ( 'Time Buckets'[Bucket] ), FILTER ( VALUES ( 'Time Buckets'[Bucket] ), [New Pallet requirement] = __overallMax ), 'Calendar'[Date] = __maxDate ) RETURN __maxPalletOccuredBucketBest
Darek