Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Network Days with Negative Values In DAX Column

Dear All  ,

Plese help me to get out of this !!!

I want Values Row by row in Calculated column followed same way as you mentioned below and it is not giving me negtive values,Please find the Below Data whichi have and Screen Captures.

Thanks In Advance.

 

Dax Formula What I used:

TBL_Date=DATESBETWEEN('Calender Table'[Date].[Date],MasterData[Invoice Date],MasterData[Payment Date])
var TBL_FinalDate=
ADDCOLUMNS(TBL_Date,"Working day",IF(WEEKDAY([Date],2)>=6,0,1),
"Holiday",IFERROR(LOOKUPVALUE('Holiday-2019'[Holidaycount],'Holiday-2019'[Holidays - 2019,2020],[Date]),0)
)
return
SUMX(TBL_FinalDate,if([Working day]=1&&[Holiday]=0,1,0))Capture1.JPGCapture2.JPG
3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Do you mean to get a continuous accumulation value instead of a total value?
You could add an index column in your table in the query editor.

Then add a condition in your SUMX formula like :

 

FILTER('Table','Table'[Index]<=EARLIER('Table'[Index]))

 

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Dear @v-eachen-msft ,

 

Current using Dax Formula:

Receipt Date to Posting Date(Working Days) =
var TBL_Date=DATESBETWEEN('Calender Table'[Date].[Date],MasterData[Invoice Received on],'MasterData'[Posted Date])
var TBL_FinalDate=
ADDCOLUMNS(TBL_Date,"Working day",IF(WEEKDAY([Date],2)>=6,0,1),
"Holiday",IFERROR(LOOKUPVALUE('Holiday-2019'[Holidaycount],'Holiday-2019'[Holidays - 2019,2020],[Date]),0)

)
return
SUMX(TBL_FinalDate,if([Working day]=1&&[Holiday]=0,1,0))
 
 
After Adding Index Column:
Invoice Date to Receipt Date(Calender Days ) =
var TBL_Date=DATESBETWEEN('Calender Table'[Date].[Date],MasterData[Invoice Date],'MasterData'[Invoice Received on])
var TBL_FinalDate=
ADDCOLUMNS(TBL_Date,"Working day",IF(WEEKDAY([Date],2)>=6,0,1),
"Holiday",IFERROR(LOOKUPVALUE('Holiday-2019'[Holidaycount],'Holiday-2019'[Holidays - 2019,2020],[Date]),0)
)
return
CALCULATE(SUMX(TBL_FinalDate,if([Working day]=1&&[Holiday]=0,1,0))-1,FILTER(MasterData,MasterData[Index]<=EARLIER(MasterData[Index])))
 
 
There is Change....
 
Thanks In Advance.
Anonymous
Not applicable

Sorry There is NO CHANGE

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.