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
Coryanthony
Helper III
Helper III

Time Intellegence logic

Hello,

I need assistance adding a time intelligence function to my mesure.

Please see measure below, these amount applies if prior to 12/1/2022. If on or after 12/1/2022, the amount increase.

I am looking to alter the measure to say, if on or after 12/1/2022, then the amount change to XX amount.

 

Allowed OT $ =
SumX(SUMMARIZE(
        Timesheet,
        Timesheet[Employee ID],Timesheet[Date],Timesheet[Holiday],Timesheet[Day of Week],
        "DailyHrs",sum(Timesheet[Number (unit)])),
    SWITCH(TRUE,
        [DailyHrs]>=4 && [DailyHrs]<8 && Timesheet[Holiday] = "Yes" ,12,
        [DailyHrs]>=8 && Timesheet[Holiday] = "Yes" ,32,
        [DailyHrs]>=10 &&'Timesheet'[Day of Week]<=4,20,
        [DailyHrs]>=4 && [DailyHrs]<8 && 'Timesheet'[Day of Week]>=5,12,
        [DailyHrs]>=8 && 'Timesheet'[Day of Week]>=5,32,
        0
        ))
 
 
Thank you 
3 REPLIES 3
amitchandak
Super User
Super User

@Coryanthony , not very clear

 

if you need date greater than a date

new measure =
var _max = maxx(allselected(Date),Date1[Date])
return
calculate( sum(Table[Value]), filter(all('Date'), 'Date'[Date] >=_max))

 

In case you need trend then you need have slicer on an independent date table

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_max))

 

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

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

Hi @amitchandak  - thank you for your response.

 

my current measure applies for all dates in calendar table. I need to add to the measure.  if date is before 12/1/22, then my current measure applies.  But if the date is on or after 12/1/2022, then i need to edit the rates. the rates increased for dates on or after 12/1/22.

 

Allowed OT $ =
SumX(SUMMARIZE(
        Timesheet,
        Timesheet[Employee ID],Timesheet[Date],Timesheet[Holiday],Timesheet[Day of Week],
        "DailyHrs",sum(Timesheet[Number (unit)])),
    SWITCH(TRUE,
        [DailyHrs]>=4 && [DailyHrs]<8 && Timesheet[Holiday] = "Yes" ,12,
        [DailyHrs]>=8 && Timesheet[Holiday] = "Yes" ,32,
        [DailyHrs]>=10 &&'Timesheet'[Day of Week]<=4,20,
        [DailyHrs]>=4 && [DailyHrs]<8 && 'Timesheet'[Day of Week]>=5,12,
        [DailyHrs]>=8 && 'Timesheet'[Day of Week]>=5,32,
        0
        ))

found a solution yet ? 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.