Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

I am getting a error when I write the following code

LYSales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Date'[Date]))

enter image description here

 

1 Answer

0 votes
by (22.5k points)

Use the following measure:

-- This reference a Measure, which in your case is not defined
LYSales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Date'[Date]))
-- you can create it with this formula
Total Sales = SUM('_TableName_'[Total Sales])

--The other way is to use only one formula
LYSales = CALCULATE(SUM('_TableName_'[Total Sales]),SAMEPERIODLASTYEAR('Date'[Date]))

If u want to learn the tool in-depth, then come to us and sign up for this Power BI Certification     

Related questions

0 votes
1 answer
asked Dec 15, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
0 votes
1 answer
asked Jan 5, 2021 in BI by Chris (11.1k points)
0 votes
1 answer

Browse Categories

...