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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KamEt69
Frequent Visitor

Creating a Measure with min and max of a datetime groupped by day

Hello,

 

I need to create a quite complicated measure.

 

It is like a login time and it is calculated ad follows.

in my table I have eventtime and I need to subtract the max and the min.

 

I acheaved this by simply creating a metric maxT and minT and subtracting them.

 

This works perfectly if I select just one day in my dashboard, but obviusly it does't if I select more than one day because it will include also the night.

 

What I would like to do is for this metric to calculate the sum of the logged time but calculated day by day.

So when is caluculated minT and maxT it should be grouped by day and agent, then subtracted to calculate the logintime for that day and then summed for more than one day or more that one agent if I so select.

 

Sorry for the poor description but since it's quite complicated I dont know how to explain it better.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@KamEt69 

It sounds like you need to look at SUMX over your 'Calendar'[Date] column.  It would look something like this.

Total Login Time = 
SUMX ( 'Calendar'[Date], [Your Measure] )

[Your Measure] is the one you already have that is working when you look at a single day.  This new measure will iterate it over the list of dates then add up the individual results.

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@KamEt69 

It sounds like you need to look at SUMX over your 'Calendar'[Date] column.  It would look something like this.

Total Login Time = 
SUMX ( 'Calendar'[Date], [Your Measure] )

[Your Measure] is the one you already have that is working when you look at a single day.  This new measure will iterate it over the list of dates then add up the individual results.

It worked, thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors