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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Display max value individual by day

Dear friends

 

please suggested me how i create max break in 1 day column that saying max break value individual by day, details as table below

 

Date          Name        Break time           Max break time in 1 day         
01-01-20John6:00 
01-01-20Jame5:005:00
01-01-20John2:00 
01-01-20John8:008:00
01-01-20Jame1:00 
02-02-20Jame3:00 
02-02-20Jame7:007:00
02-02-20John4:004:00
02-02-20John2:00 

 

Can any one please suggest me.

 

Thanks 

3 ACCEPTED SOLUTIONS
nandu_krishna
Microsoft Employee
Microsoft Employee

@Anonymous 

 

Try below DAX in a calculated column

 

MaxBreak =
VAR __maxTime =
    MAXX (
        FILTER (
            'Table',
            'Table'[Date] = EARLIER ( 'Table'[Date] )
                && 'Table'[Name] = EARLIER ( 'Table'[Name] )
        ),
        'Table'[Break time]
    )
VAR __result =
    IF ( 'Table'[Break time] = __maxTime, __maxTime, BLANK () )
RETURN
    __result

output.PNG

 

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂

View solution in original post

amitchandak
Super User
Super User

@Anonymous , Try like

if([break time] =maxx(filter(table, [name]=earlier([name]) && [date]=earlier([date])),[break time]) ,[break time],blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Fowmy
Super User
Super User

@Anonymous 

Try this as measure:

Measure = 
VAR BT =  
CALCULATE(
    MAX('Table'[Break time           ]),
    ALLEXCEPT('Table', 'Table'[Name        ],'Table'[Date          ]))

RETURN

IF( BT = MAX('Table'[Break time           ]),FORMAT(BT,"hh:mm"),"")

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

6 REPLIES 6
Fowmy
Super User
Super User

@Anonymous 

Try this as measure:

Measure = 
VAR BT =  
CALCULATE(
    MAX('Table'[Break time           ]),
    ALLEXCEPT('Table', 'Table'[Name        ],'Table'[Date          ]))

RETURN

IF( BT = MAX('Table'[Break time           ]),FORMAT(BT,"hh:mm"),"")

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Anonymous , Try like

if([break time] =maxx(filter(table, [name]=earlier([name]) && [date]=earlier([date])),[break time]) ,[break time],blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
nandu_krishna
Microsoft Employee
Microsoft Employee

@Anonymous 

 

Try below DAX in a calculated column

 

MaxBreak =
VAR __maxTime =
    MAXX (
        FILTER (
            'Table',
            'Table'[Date] = EARLIER ( 'Table'[Date] )
                && 'Table'[Name] = EARLIER ( 'Table'[Name] )
        ),
        'Table'[Break time]
    )
VAR __result =
    IF ( 'Table'[Break time] = __maxTime, __maxTime, BLANK () )
RETURN
    __result

output.PNG

 

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂

Anonymous
Not applicable

@nandu_krishna nice solution, i have another question what if i need to show "Need a break" instead of show max break in Max break in 1 time column what should i do cause i just try to adjust your dax like below but its go wrong.

 

Event =
VAR __maxTime =
MAXX (
FILTER (
'Detailed Trip Report (Break)',
'Detailed Trip Report (Break)'[Date] = EARLIER ( 'Detailed Trip Report (Break)'[Date] )
&& 'Detailed Trip Report (Break)'[AssetName] = EARLIER ( 'Detailed Trip Report (Break)'[AssetName] )
),
'Detailed Trip Report (Break)'[ref.Event]
)
VAR __result =
IF ( 'Detailed Trip Report (Break)'[ref.Event] = __maxTime,"Need more break", BLANK () )
RETURN

@Anonymous 

In your DAX, I could see that you are not returning the __result variable.

 

 

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂

Anonymous
Not applicable

@nandu_krishna Thank you so much : )

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.