Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
austinb97
Regular Visitor

first value by date

Hi, 
 
I currently have the below formula which works to give me a max value. However, the issue is if I have a date with two or more identical max values, the formula returns this max value on both rows. I only want to return the first occurance of this max value. How can I modify this formula to only give me the first occurance of the max value?
 
Hourly Price Setter With Duplicates =
VAR MAXVALUE =
CALCULATE(
MAX(MeritOrder[Price]),
ALLEXCEPT(MeritOrder,MeritOrder[Date],MeritOrder[Dispatched])
)
RETURN
IF(
MAXVALUE=MeritOrder[Price] && MeritOrder[Dispatched]="Y",
MAXVALUE,
BLANK()
)
2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @austinb97 ,

 

Based on my test, it works well. It's a calculated column. In the two rows of the same date, he only returned the row with the largest value.

5.png

Please provide sample data and expected results.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

ryan_mayu
Super User
Super User

@austinb97 

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.