Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.