Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to calculate the hours difference between Total Hours and orginal work hours which has date slicer .
Dax Query should be written as below and after this conditions have been met then have to calculate the difference between orginal workhours and Total hours
Conditions are below orginalwork hours should not be equal to total hours or cannot be null plus approval date time should be greater than previous month (1 month minus) than todays date
WHERE PROJ.Active = 1 AND TAR.ApprovalStatusID IN (5,7,8)
(TAE.OriginalWorkHours,0) != TAE.Total Hours
TAE.OriginalWorkHours is not null
TAR.ApprovalDateTime>DATEADD(s, -1, DATEADD(m, DATEDIFF(m, 0, @pendwkdate)+1, 0))
then difference between orginalworkhours-Totalhours
I am trying to write the conditions in Dax but its saying its incorrect
= var = maxx(FILTER('ATAS REPORT','ATAS REPORT'[OriginalWorkHours] <> 'ATAS REPORT'[Total Hours] = 'ATAS REPORT'[Total Hours] return MAXX(FILTER('ATAS REPORT','ATAS REPORT'[OriginalWorkHours] <> NULL() )
Solved! Go to Solution.
@dbollini , check if this can help
CalculatedColumn =
VAR MaxDate = TODAY()
VAR OneMonthAgo = EOMONTH(MaxDate, -1)
RETURN
IF(
'Table'[Active] = 1 &&
'Table'[ApprovalStatusID] IN {5, 7, 8} &&
'Table'[OriginalWorkHours] <> 'Table'[Total Hours] &&
NOT(ISBLANK('Table'[OriginalWorkHours])) &&
'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY),
'Table'[OriginalWorkHours] - 'Table'[Total Hours],
BLANK()
)
what happens when you adjust 'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY) to
'Table'[ApprovalDateTime] > DATEADD('Calendar'[Date], -1, DAY)?
I am struggling with this can someone help thanks
@dbollini , check if this can help
CalculatedColumn =
VAR MaxDate = TODAY()
VAR OneMonthAgo = EOMONTH(MaxDate, -1)
RETURN
IF(
'Table'[Active] = 1 &&
'Table'[ApprovalStatusID] IN {5, 7, 8} &&
'Table'[OriginalWorkHours] <> 'Table'[Total Hours] &&
NOT(ISBLANK('Table'[OriginalWorkHours])) &&
'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY),
'Table'[OriginalWorkHours] - 'Table'[Total Hours],
BLANK()
)
Thank You for Taking time to answer this and i tried various ways
what happens when you adjust 'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY) to
'Table'[ApprovalDateTime] > DATEADD('Calendar'[Date], -1, DAY)?
Thank you and i tried
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
65 | |
64 | |
56 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |