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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
AmazingRandom
Helper II
Helper II

How to summarize a grouped date with the highest value

This is a very new experience to me and after a few attempts I am out of ideas on how to achieve this.

 

Essentially, I need to show the highest condition for the day, however our data is being captured hourly, so I need to group the timestamps by date. That first part I managed to do easily. The second bit is where I'm stuck. 

AmazingRandom_1-1710710479476.png

 

Above is a screenshot of a scenario. Ignore the Manual and Current non compliant columns as the condition column already calculates the final values I need to summarise. So for this instance, the whole day should be flagged as 1, how can I make a new column that will look at the highest condition valueof the day and return it, this means the new column should only have the value 1 across all rows. Thanks in advance

1 ACCEPTED SOLUTION
samratpbi
Super User
Super User

Hi, considering that you would need a column, I created this sample dataset and created a conditional column:

samratpbi_0-1710712047706.png

Below is the column calculation:

MaxCond =
CALCULATE(
    MAX(DateCond[Condition]),
    ALLEXCEPT(
        DateCond,
        DateCond[orderdate]
    )
)
As you can see 05/03/2024 has max condition 1, 06/03 has 0 and 07/03 has 2
 
If this resolves your problem, then please accept this as solution to help others. Thanks!

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

Highest condition value = calculate(max(Data[Condition]),filter(Data,Data[Date]=earlier(Data[Date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

It didn't work, I'm getting the highest value possible in all rows, which is 2

samratpbi
Super User
Super User

Hi, considering that you would need a column, I created this sample dataset and created a conditional column:

samratpbi_0-1710712047706.png

Below is the column calculation:

MaxCond =
CALCULATE(
    MAX(DateCond[Condition]),
    ALLEXCEPT(
        DateCond,
        DateCond[orderdate]
    )
)
As you can see 05/03/2024 has max condition 1, 06/03 has 0 and 07/03 has 2
 
If this resolves your problem, then please accept this as solution to help others. Thanks!

It worked, I had to edit the formula to also filter by location. I got a follow up question, how can I aggregate that into one single value for count? Off your example, there would be a count for each condition. Though it counts only one instance. So there would be 

 

0 = 1 day

1 = 1 day

2 = 1 day

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.