exam questions

Exam PL-300 All Questions

View all questions & answers for the PL-300 exam

Exam PL-300 topic 2 question 10 discussion

Actual exam question from Microsoft's PL-300
Question #: 10
Topic #: 2
[All PL-300 Questions]

HOTSPOT -
You have a Power BI model that contains a table named Sales and a related date table. Sales contains a measure named Total Sales.
You need to create a measure that calculates the total sales from the equivalent month of the previous year.
How should you complete the calculation? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Leonardorcaquino
Highly Voted 2 years, 7 months ago
CALCULATE SAMEPERIODLASTYEAR 'DATE'[DATE]
upvoted 263 times
KoS83
2 years, 2 months ago
Correct! PARALLELPERIOD needs 3 arguments and it returns the sales for the entire year
upvoted 13 times
...
maymia87
1 year, 1 month ago
There's a Sum missing. CALCULATE(SUM(), SAMEPERIODLASTYEAR(Date[Date]))
upvoted 1 times
maymia87
1 year, 1 month ago
Nevermind, Sum isn't necessary as Total Sales is a measure not a column and already calculates the Sum.
upvoted 16 times
...
...
cokimon
1 year, 5 months ago
This would return the sales on that single date of last year. You need date[month] to get the sales for the entire month of last year.
upvoted 4 times
Dani_eL
1 year, 2 months ago
no. date([month]) will throw an error as the function expects a DATE format and month is integer(or string if format mmm). It MUST be date[Date]
upvoted 7 times
...
...
...
Muffinshow
Highly Voted 2 years, 7 months ago
Calculate SamePeriodLastYear 'Date'[Month] ParallelPeriod could work but here the second agrument only takes one parameter and ParallelPeriod requires three
upvoted 53 times
Mati81111
2 years, 7 months ago
SAMEPERIODLASTYEAR accepts a data column, Month will usually be either text (Jan) or Integer (1). so: CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
upvoted 71 times
jsking
2 years, 4 months ago
Yup! This is correct!!
upvoted 1 times
...
...
babinaprad
2 years, 7 months ago
Which one is the correct answer is it 'Date[Month] or 'Date'[Date] as it has got equal number of votes so confused.
upvoted 4 times
NaudeDucon
9 months, 1 week ago
'Date'[Date] is the correct type of data. Then you could make use of Table visualization with a column as 'Date'[Month] to see all the Sales of each previous month
upvoted 3 times
...
cokimon
1 year, 5 months ago
You need date[month] to get the sales for the entire month of last year.
upvoted 1 times
...
catpoisoncat
2 years, 3 months ago
I guess 'Date'[Date]. If you look up for the SAMEPERIODLASTYEAR DAX, it has a Date parameter.
upvoted 3 times
...
...
...
Mi4as
Most Recent 1 month, 1 week ago
In the middle option, no one isn't absolutely correct. CALCULATE( [Total Sales], SAMEPERIODLASTYEAR ( ENDOFMONTH ( 'Date'[Date] ) ) -- Without EndOfMonth function, you received the total year result instead of the month )
upvoted 1 times
Mi4as
1 month, 1 week ago
Please delete or ignore my post. The ENDOFMONTH is not needed.
upvoted 1 times
...
...
Fatima300
2 months, 4 weeks ago
CALCULATE( [Total Sales], SAMEPERIODLASTYEAR('Date'[Date]) )
upvoted 1 times
...
raavilam
3 months ago
Tested. CALCULATE , SAMEPERIODLASTYEAR , DATE[DATE] is the right answer
upvoted 2 times
...
MANANDAVEY
3 months, 2 weeks ago
CALCULATE SAMEPERIODLASTYEAR 'DATE'[DATE] Tried and tested 100%
upvoted 1 times
...
jaume
5 months, 2 weeks ago
Absolutely, PARALLELPERIOD(<dates>,<number_of_intervals>,<interval>) requires three arguments that are not passed in the proposed code. My vote for: - CALCULATE (by the way, a parenthesis is missed there) - SAMEPERIODLASTYEAR - Date[Date]...here I was initially going for Date[Month] but explanations make me realize it should be Date[Date]
upvoted 1 times
...
rcaliandro
8 months, 2 weeks ago
The correct answer is CALCULATE, SAMEPERIODLASTYEAR, 'Date'[Month]
upvoted 1 times
rcaliandro
8 months, 1 week ago
Sorry I was wrong! If you use Date[Month] It will raise an error because The specified month column in the SAMEPERIODLASTYEAR function is not of type DATE. It should be the following configuration: - CALCULATE - SAMEPERIODLASTYEAR - 'Date'[Date]
upvoted 3 times
...
...
Sophieeeeee
10 months ago
Have tried to build the measures. It woks with the following: 1. SAMEPERIODLASTYEAR(<dates>) Sales Previous Year = CALCULATE([Total Sales],SAMEPERIODLASTYEAR(Date[Date])) 2. PARALLELPERIOD(<dates>,<number_of_intervals>,<interval>) Sales Previous Year = CALCULATE([Total ales],PARALLELPERIOD(Date[Date],-12,MONTH)) 3. DATEADD(<dates>,<number_of_intervals>,<interval>) Sales Previous Year = CALCULATE([Total Sales],DATEADD(Date[Date],-12,MONTH))
upvoted 5 times
...
SureshReddyMoole
11 months, 1 week ago
CALCULATE is used to change the context in which the data is evaluated. [Total Sales] is your existing measure that calculates total sales. SAMEPERIODLASTYEAR('Date'[Date]) shifts the context of the date by one year, allowing the calculation to be made for the same period last year. This measure will give you the total sales for the same month in the previous year. Make sure that your date table ('Date') is marked as a date table and properly related to your Sales table.
upvoted 2 times
...
bernardoklosowski
1 year, 2 months ago
It needs to be 'DATE'[DATE] because SAMEPERIODLASTYEAR only accepts Date columns as arguments. If you try to input the Month column the following error is prompted: "MdxScript(Model) (216, 5) Calculation error in measure •_ProjectMeasures'[Measure Last Year]: A column specified in the call to function 'SAMEPERIODLASTYEAR' is not of type DATE. This is not supported."
upvoted 2 times
...
Dani_eL
1 year, 2 months ago
AS per Microsoft Definition found in: https://learn.microsoft.com/en-us/dax/sameperiodlastyear-function-dax Example The following sample formula creates a measure that calculates the previous year sales of Reseller sales. DAX: LastYearSales= CALCULATE(SUM(ResellerSales_USD[SalesAmount_USD]), SAMEPERIODLASTYEAR(DateTime[DateKey]))
upvoted 2 times
...
GowthamMupparapu
1 year, 2 months ago
The data recording frequency is not specified, but based on the snap, we should assume that the data is recorded on a monthly basis. In accordance with this assumption, the syntax using PARALLELPERIOD AND SAMEPERIODLASTYEAR would be: 1. CALCULATE(SUM('Table Name'[Total Sales]), PARALLELPERIOD('Table Name'[Date], -12, Month) 2.CALCULATE(SUM('Table Name'[Total Sales]), SAMEPERIODLASTYEAR('Table Name'[Date])) Given only one argument in the final box, this is the correct answer - CALCULATE, SAMPERIODLASTYEAR, DATE[DATE]
upvoted 2 times
...
Roh1410
1 year, 3 months ago
CALCULATE SAMEPERIODLASTYEAR 'DATE'[DATE] / 'DATE'[MONTH]
upvoted 1 times
...
MayurV19
1 year, 4 months ago
Answer is wrong and misleading. Correct answers: CALCULATE SAMEPERIODLASTYEAR 'DATE'[DATE] We should use SAMEPERIODLASTYEAR because it as a function would calculate the expression for the previous year period to the period in filter context. Also, we should input the 'DATE'[DATE] column for references the previous year period.
upvoted 1 times
...
Kostali
1 year, 4 months ago
The correct : 1) CALCULATE 2) SAMEPERIODLASTYEAR 3) 'DATE'[DATE] The fonction accepte 3 param like this PARALLELPERIOD(<dates>,<number_of_intervals>,<interval>)
upvoted 2 times
...
agelee
1 year, 5 months ago
The Suggested Answers are so ridiculous. I answer correctly and later get irritated that again wrong answers under 'Show Suggested Answer'. Mine: CALCULATE SAMEPERIODLASTYEAR 'DATE'[DATE]
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago