March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I would like a DAX formula that would return the DateTime corresponding to the MAX of Price on this list.
27 is the largest Price, so the answer should be either 17/12/2020 17:00 or 18/12/2020 18:00, I don't mind which one:
Here is the formula that I am currently using:
DateTime of most expensive product =
CALCULATE (
FIRSTNONBLANK ( Data[DateTime], 1 ),
FILTER ( Data, MAX ( Data[Price] ) )
)
The result appearing is 10:00. This is not the required result. I can see what its doing, its returning the first row that is not blank. But I don't know which other "wrapper" I can use? I tried using LOOKUPVALUE, but as I have a duplicate this does not work.
Any help would be appreciated. Here is the sample file:
https://www.dropbox.com/s/a5001h3htve47lf/Sample%20file.pbix?dl=0
Solved! Go to Solution.
@vpatel55 - try the following:
Measure =
VAR __maxPrice = CALCULATE(MAX('Table'[Price]),ALL('Table'))
RETURN
CALCULATE(
MAX('Table'[DateTime]),
'Table'[Price] = __maxPrice
)
Proud to be a Super User!
@vpatel55 - try the following:
Measure =
VAR __maxPrice = CALCULATE(MAX('Table'[Price]),ALL('Table'))
RETURN
CALCULATE(
MAX('Table'[DateTime]),
'Table'[Price] = __maxPrice
)
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
127 | |
85 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |