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.
Hi,
Please need help to exlude weekend from dates diff in the same column. The below formula works good for me and return the correct count of days.
Column = VAR temp = TOPN ( 1, FILTER ( 'Customer visit', 'Customer visit'[Customer id] = EARLIER ( 'Customer visit'[Customer id] ) && 'Customer visit'[DateOfVisit] < EARLIER ( 'Customer visit'[DateOfVisit] ) ), [DateOfVisit], DESC ) RETURN DATEDIFF ( MINX ( temp, [DateOfVisit] ), 'Customer visit'[DateOfVisit], DAY )
Thanks in advance
Solved! Go to Solution.
This is easier if you have a date dimension table so that you can iterate over days and count them like this:
[...]
RETURN
COUNTROWS (
FILTER (
'Calendar',
'Calendar'[Date] <= 'Customer visit'[DateOfVisit]
&& 'Calendar'[Date] > MINX ( temp, [DateOfVisit] )
&& WEEKDAY ( 'Calendar'[Date] ) IN { 2, 3, 4, 5, 6 }
)
)
This is easier if you have a date dimension table so that you can iterate over days and count them like this:
[...]
RETURN
COUNTROWS (
FILTER (
'Calendar',
'Calendar'[Date] <= 'Customer visit'[DateOfVisit]
&& 'Calendar'[Date] > MINX ( temp, [DateOfVisit] )
&& WEEKDAY ( 'Calendar'[Date] ) IN { 2, 3, 4, 5, 6 }
)
)
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 |
---|---|
19 | |
7 | |
6 | |
5 | |
4 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |