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...
Devender_Power
2 years agoRegular Visitor
The issue is that Lastdate is dynamic and because of it it is not giving correct output try the below
ThisMonthBasedOnInvoices =
VAR _thisyear = YEAR(TODAY())
VAR _lastinvoicedate = Calculate(LASTDATE(Consolidated_Sales_ActualTable[Sales_Invoice_date]),all(Consolidated_Sales_ActualTable))
VAR _calculation = MONTH(_lastinvoicedate)
RETURN
_calculation
Best Regards
Devender Kumar
If this helps, then please consider Accept it as the solution to help the other members find it more quickly.