Forum Discussion
nps59718
8 years agoFrequent Visitor
A function 'CALCULATE' has been used in a True/False expression - Simple Date comparison
Hi There, I'm looking for a more elegant way sum based on a prior business day calculation. The following *does work* but will get a little more cumbersome when doing MTD or YTD calculations: ...
- 8 years ago
Try this one
Prior Day Invoiced = VAR PreviousBusinessDay = [Priorbusinessday] RETURN CALCULATE ( SUM ( 'Sales Ledger Transactions'[Net Sales] ), 'Sales Ledger Transactions'[Fact Attributes.Source Sale Type Code] = "INVOICED", 'Sales Ledger Transactions'[Date.Date] = PreviousBusinessDay )
Zubair_Muhammad
Community Champion
8 years ago
Try this one
Prior Day Invoiced =
VAR PreviousBusinessDay = [Priorbusinessday]
RETURN
CALCULATE (
SUM ( 'Sales Ledger Transactions'[Net Sales] ),
'Sales Ledger Transactions'[Fact Attributes.Source Sale Type Code] = "INVOICED",
'Sales Ledger Transactions'[Date.Date] = PreviousBusinessDay
)