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
Hi, I have a measure that correctly identifies the largest value in the "Multi Search Visits" column.
The table/Measure name is '3 - Metric'[Multi Search Visits]
The measure has the value of 16638.
My goal is the find the date that matches this value, which s/b 10/19/2022, but it picks up the the latest date, not the correct one.
This is the measure I'm trying to use, which doesn't get me the specific date on the same row. I know the MAXX returns the latest date, but having trouble building it to find the specific date?
I tried, this didn't work
Solved! Go to Solution.
hi, @Anonymous
Hi @Anonymous ,
Can you try the following:
Add a calculated column to your table like this:
IsMaxVisit =
VAR largestValue = CALCULATE([Measure that calculates largest value],ALL())
RETURN
IF('3 - Metric'[Multi Search Visits] =largestValue, "Yes","No")
When you add that column to the table visual it should say "Yes" exactly once, and "No" for all other occasions, except if you have multiple dates with the same exact visitor count.
Then you can make a measure like this:
Date with most visits =
CALCULATE(MIN('3 - Metric'[MetricDate]),'3 - Metric'[IsMaxVisit]="Yes")
And it should return you the correct date in a measure. Again, if you have multiple dates with the same visitor count, this measure will return the earliest (MIN) date. If you want the latest one replace with MAX. If you want your measure to show a list of all the dates where the view count equals the maximum, that will be a bit more complicated and I am not sure how to do that off the top of my head :/.
I hope this helps, let me know if you run into any issues.
Proud to be a Super User! | |
this worked absolutely terrific, and will be an excellent template to use with other measures that I have. Thank you!
Hi @Anonymous ,
Can you try the following:
Add a calculated column to your table like this:
IsMaxVisit =
VAR largestValue = CALCULATE([Measure that calculates largest value],ALL())
RETURN
IF('3 - Metric'[Multi Search Visits] =largestValue, "Yes","No")
When you add that column to the table visual it should say "Yes" exactly once, and "No" for all other occasions, except if you have multiple dates with the same exact visitor count.
Then you can make a measure like this:
Date with most visits =
CALCULATE(MIN('3 - Metric'[MetricDate]),'3 - Metric'[IsMaxVisit]="Yes")
And it should return you the correct date in a measure. Again, if you have multiple dates with the same visitor count, this measure will return the earliest (MIN) date. If you want the latest one replace with MAX. If you want your measure to show a list of all the dates where the view count equals the maximum, that will be a bit more complicated and I am not sure how to do that off the top of my head :/.
I hope this helps, let me know if you run into any issues.
Proud to be a Super User! | |
hi, @Anonymous
this worked great and thank you! sure wish it was a bit simpler to do, such as in Excel.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
128 | |
90 | |
75 | |
56 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |