Forum Discussion
2NV_DB
2 years agoFrequent Visitor
Different result when using Measure as a variable vs using a scalar.
Hi there, I have a dax measure that finds the last date within the exisiting year of a data set and then it extracts the month: ThisMonthBasedOnInvoices =
VAR _thisyear = YEAR(TODAY())
VA...
Jihwan_Kim
2 years agoSuper User
Hi,
In my opinion, it is because of context transition when using [measure] inside CALCULATE DAX function.
Row context -> Filter context
CALCULATE function (DAX) - DAX | Microsoft Learn
Please try something like below whether it suits your requirement.
IncrementalSales24 =
VAR _condition = [ThisMonthBasedOnInvoices]
VAR _result =
CALCULATE (
( [SalesSum24] - [SalesSum23] ),
FILTER (
'Financial Calendar',
'Financial Calendar'[Month Number] <= _condition
)
)
RETURN
_result
2NV_DB
2 years agoFrequent Visitor
Thanks for the reply but unfortunately that doesn't work either.
The chart looks like this:
The _condition returns 5 as well.