Forum Discussion
Anonymous
4 years agoNot applicable
Previous working day Total
I am trying to get a total for the previous working day total in my model My data is structured as below PO No Purch Date Quantity 100008 30-Sep-21 40 100010 1-Oct-21 15 1000...
- Anonymous4 years ago
Hi Anonymous ,
I updated your sample pbix file(see attachment), please check whether that is what you want.
Previous Work Day Qty = VAR _curdate = SELECTEDVALUE ( 'Purch Fact'[Purch Date] ) VAR _preworkdate = CALCULATE ( MAX ( 'Calendar'[Date] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] < _curdate && WEEKDAY ( 'Calendar'[Date], 2 ) <= 5 ) ) RETURN IF ( DAY ( _curdate ) = 1, [Total Qty], SUMX ( FILTER ( ALLSELECTED ( 'Purch Fact' ), 'Purch Fact'[Purch Date] = _preworkdate ), [Total Qty] ) ) + 0Best Regards
Jihwan_Kim
Super User
4 years agoHi,
Thank you for your message.
Sorry to say that it is quite difficult to fully understand your question without seeing the model and visualization.
I think you already shared the link of your model, but if it is different now, could you please let me know again the link or your model?
Anonymous
4 years agoNot applicable
Thanks Jihwan_Kim . Let me see if i can take a sample of that model for you.
Just curious what is the significance of that HASONEVALUE in the measure. Looks to me that it is causing the issue in my measure. Trying to see if i can avoid and use it.