table variables
1 TopicNETWORKDAYS overriding Variables
Hello, I was struggling with the new function NETWORKDAYS, that does not give the proper value at total. I insvestigated, and end up, to the following DAX to put in evidence the issue ; Duration in work days from Release date to Last Ship Date = Var selection = ADDCOLUMNS( CALCULATETABLE( FACT_CUSTOMER_ORDER_LINE_C, FILTER(FACT_CUSTOMER_ORDER_LINE_C , FACT_CUSTOMER_ORDER_LINE_C[Date First Released] <> BLANK() && FACT_CUSTOMER_ORDER_LINE_C[Date Last Actual Ship] <> BLANK() && FACT_CUSTOMER_ORDER_LINE_C[Date First Released] >= DATE(2022,01,05) ) ) , "Date First Released bis" , FACT_CUSTOMER_ORDER_LINE_C[Date First Released] ) VAR list_with_days = ADDCOLUMNS( selection , "calc_duration_work_day" , VAR selected_site = SELECTEDVALUE(DIM_SITE[Site]) VAR list_exception = UNION( CALCULATETABLE( SELECTCOLUMNS('Calendar WORK_TIME_EXCEPTION_C', "exception date" ,'Calendar WORK_TIME_EXCEPTION_C'[EXCEPTION_DATE] ), TREATAS({selected_site},'Calendar WORK_TIME_EXCEPTION_C'[SITE] ) ) , {[Date Last Actual Ship] } ) RETURN NETWORKDAYS([Date First Released bis] , [Date Last Actual Ship] , 1 , list_exception ) ) return CONCATENATEX(list_with_days , FACT_CUSTOMER_ORDER_LINE_C[Date First Released] & " to " & FACT_CUSTOMER_ORDER_LINE_C[Date Last Actual Ship] & " give " & [calc_duration_work_day] , ", " , FACT_CUSTOMER_ORDER_LINE_C[Date First Released] ,ASC ) Here below is the resulut I et. I thought the the duation of days would be stored in the variable "list_with_days" and frozen. But t seems the duration of days by line given afterwards has a different value. Does anyone already met this kind or issue ? Thanks in advance to the community for the support. AnthonySolved913Views0likes1Comment