Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Community,
I need help! I have this measure to calculated the no of days of leaves taken as following:
Solved! Go to Solution.
Hi, @Anonymous
Let me talk about the reason for the error first, because you did not put the start and end date columns in second matrix, so that the measure can only get the largest date.
So you need to define a context in the measure first, so that even if you don't put the start and end dates, it won't affect the result.
Like this:
Measure 2 =
SUMX (
ADDCOLUMNS (
SUMMARIZE ( 'Table', [Emp], 'Table'[leave start date], 'Table'[leave end date] ),
"diff",
COUNTROWS (
FILTER (
Datedim,
Datedim[Date] >= EARLIER ( 'Table'[leave start date] )
&& Datedim[Date] <= EARLIER ( 'Table'[leave end date] )
)
)
),
[diff]
)
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Hi, @Anonymous
Let me talk about the reason for the error first, because you did not put the start and end date columns in second matrix, so that the measure can only get the largest date.
So you need to define a context in the measure first, so that even if you don't put the start and end dates, it won't affect the result.
Like this:
Measure 2 =
SUMX (
ADDCOLUMNS (
SUMMARIZE ( 'Table', [Emp], 'Table'[leave start date], 'Table'[leave end date] ),
"diff",
COUNTROWS (
FILTER (
Datedim,
Datedim[Date] >= EARLIER ( 'Table'[leave start date] )
&& Datedim[Date] <= EARLIER ( 'Table'[leave end date] )
)
)
),
[diff]
)
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.