Forum Discussion
nanutum
Helper I
6 years agoLASTDATE ERROR MDXSCRIPT PLEASE HELP
i have 2 meaure can used normally but today get error below please help Stock_Case_LastDate = SUMX (
VALUES ( 'Sold to party' ),
CALCULATE ( SUM ( Stock[Case]),LASTDATE( ( Stock[Sto...
Anonymous
6 years agoNot applicable
nanutum
As the error clearly says, LASTDATE is a table function that operates on a column of dates but the dates must be UNIQUE. This function should be used on a proper Date table in the model, not just on any column that happens to store dates.
Please create a proper calendar in your model, connect to your fact table and you'll be good to go.
By the way, your model should be a star schema. Please refer to this: https://docs.microsoft.com/en-us/power-bi/guidance/star-schema#star-schema-overview
As the error clearly says, LASTDATE is a table function that operates on a column of dates but the dates must be UNIQUE. This function should be used on a proper Date table in the model, not just on any column that happens to store dates.
Please create a proper calendar in your model, connect to your fact table and you'll be good to go.
By the way, your model should be a star schema. Please refer to this: https://docs.microsoft.com/en-us/power-bi/guidance/star-schema#star-schema-overview
nanutum
Helper I
6 years agoi very confused this 2 measure is not error in lastweek