This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
hello,
as suggested in earlier discussions for calculating the networkdays / weekdays between dates; i created a table "Calendar" and then a flag "Check" which will be 1 for weekdays and 0 otherwise.
i know tried to create a column as below but the error "an invalid numeric representation of a date value was encountered".
DaysGiven2 = var New1 = CALCULATE(MAXX(RRTRequestsStatusChanges,RRTRequestsStatusChanges[Date]),FILTER(RRTRequestsStatusChanges,RRTRequestsStatusChanges[New]="1 New"),FILTER(RRTRequests,RRTRequests[RequestID]=RRTRequestsStatusChanges[FiD])) return CALCULATE(SUM('Calendar'[Check]),DATESBETWEEN('Calendar'[CalendarDate],RRTRequestsStatusChanges[StartDate],New1))
Let me know what wrong...
Solved! Go to Solution.
Hi @prabhupan,
Could you try the formula below to see if it works?![]()
DaysGiven2 =
VAR New1 =
CALCULATE (
MAXX ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[Date] ),
FILTER ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[New] = "1 New" ),
FILTER ( RRTRequests, RRTRequests[RequestID] = RRTRequestsStatusChanges[FiD] )
)
RETURN
CALCULATE (
SUM ( 'Calendar'[Check] ),
FILTER (
Calendar,
'Calendar'[CalendarDate] >= RRTRequestsStatusChanges[StartDate]
&& 'Calendar'[CalendarDate] <= New1
)
)
Regards
Hi @prabhupan,
Could you try the formula below to see if it works?![]()
DaysGiven2 =
VAR New1 =
CALCULATE (
MAXX ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[Date] ),
FILTER ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[New] = "1 New" ),
FILTER ( RRTRequests, RRTRequests[RequestID] = RRTRequestsStatusChanges[FiD] )
)
RETURN
CALCULATE (
SUM ( 'Calendar'[Check] ),
FILTER (
Calendar,
'Calendar'[CalendarDate] >= RRTRequestsStatusChanges[StartDate]
&& 'Calendar'[CalendarDate] <= New1
)
)
Regards
hello @v-ljerr-msft,
Infact it works with a slight change.
DaysGiven2 =
VAR New1 =
CALCULATE (
MAXX ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[Date] ),
FILTER ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[New] = "1 New" ),
FILTER ( RRTRequests, RRTRequests[RequestID] = RRTRequestsStatusChanges[FiD] )
)
RETURN
CALCULATE (
SUM ( 'Calendar'[Check] ),
FILTER (
'Calendar',
'Calendar'[CalendarDate] >= New1
&& 'Calendar'[CalendarDate] <= RRTRequestsStatusChanges[StartDate]
)
)
Thanks for your suggestion. ![]()
Hi @prabhupan,
Just trying to understand where your error is.
What do you get when you run just the following
DaysGiven2 test =
VAR New1 =
CALCULATE (
MAXX ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[Date] ),
FILTER ( RRTRequestsStatusChanges, RRTRequestsStatusChanges[New] = "1 New" ),
FILTER ( RRTRequests, RRTRequests[RequestID] = RRTRequestsStatusChanges[FiD] )
)
Return New1
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 25 | |
| 23 | |
| 19 | |
| 17 | |
| 14 |
| User | Count |
|---|---|
| 24 | |
| 23 | |
| 20 | |
| 20 | |
| 19 |