cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ZataConsulting Frequent Visitor
Frequent Visitor

MdxScript(Model)(187,74).....Calulcation error in measure

I have use the followin formu;ar Total Revenue LY = Calculate([Total Revenue],SAMEPERIODLASTYEAR(DimDate[Date].[Year])) and get the following error message

 

 

 

Here is part of the error message: 'Calculated Measures'[Total Revenue LY]; A column specified in the call to function " SAMEPRIOD LASTYEAR" is not date type.  AM finding this difficult to understand. The Date COlumn is a date ctype. I have tried to use DATEADD , but I still get the same error. I have looked in most discussion , I have not found a solution. Can anyone help. 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-jiascu-msft
Microsoft

Re: MdxScript(Model)(187,74).....Calulcation error in measure

Hi @ZataConsulting,

 

Please try again without the ".[Year]" part. 

 

Total Revenue LY =
CALCULATE ( [Total Revenue], SAMEPERIODLASTYEAR ( DimDate[Date].[Year] ) )

Mdx_Script_Model

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Interkoubess Established Member
Established Member

Re: MdxScript(Model)(187,74).....Calulcation error in measure

Hi @ZataConsulting,

 

Please create a date table ( with continuous date) and link it to your "fact" table.

Then you can use these formula to calculate previous period revenue.

 

We can assist if you have any issues.

 

 

Ninter

Microsoft v-jiascu-msft
Microsoft

Re: MdxScript(Model)(187,74).....Calulcation error in measure

Hi @ZataConsulting,

 

Please try again without the ".[Year]" part. 

 

Total Revenue LY =
CALCULATE ( [Total Revenue], SAMEPERIODLASTYEAR ( DimDate[Date].[Year] ) )

Mdx_Script_Model

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

ZataConsulting Frequent Visitor
Frequent Visitor

Re: MdxScript(Model)(187,74).....Calulcation error in measure

Total Revenue LY =
CALCULATE ( [Total Revenue], SAMEPERIODLASTYEAR ( DimDate[Date].[Year] ) )

  Thankyou. The solution works. 

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)