Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 maxpalletoccuredday =
CALCULATE (
MAX ( 'Calendar'[Date] ),
FILTER (
VALUES ( 'Calendar'[Date] ),
[Max Pallet positions per day] = overallmax
)
)
VAR maxpalletoccuredbucket =
CALCULATE (
MAX ( 'Time Buckets'[Bucket] ),
FILTER (
VALUES ( 'Time Buckets'[Bucket] ),
[New Pallet requirement] = overallmax
)
)
RETURN
maxpalletoccuredbucket
I doubt that, the max worked for date. But the second time, the max is applied on data type text.
I am not sure that max fits in here. Could anyone lists the dax function that results a single value similar to max but not arithmatic function.
Thanks
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 __maxPalletOccuredBucket
You 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
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
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
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 __maxPalletOccuredBucket
Best
Darek
Hi @vissvess
Can you create a data sample that represents your requierment and use this sample to show the desired outcome?
In short, I am in need of finding the value that corresponds to max value of a measure.
In detail,
I have a measure which returns a particular value.
I want to get the particular field value which corresponds to the max of measure output.
I am not well in dax. So, feel free to neglect my code in case and propose new code.
Any help would be so thankful.
Thanks in advance.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
17 | |
12 |