exam questions

Exam DA-100 All Questions

View all questions & answers for the DA-100 exam

Exam DA-100 topic 4 question 6 discussion

Actual exam question from Microsoft's DA-100
Question #: 6
Topic #: 4
[All DA-100 Questions]

HOTSPOT -
You are enhancing a Power BI model that has DAX calculations.
You need to create a measure that returns the year-to-date total sales from the same date of the previous calendar year.
Which DAX functions should you use? 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:
Reference:
https://www.kasperonbi.com/get-the-ytd-of-the-same-period-last-year/
Deploy and Maintain Deliverables

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
AValester
Highly Voted 4 years ago
The answer is correct. CALCULATE and DATEBETWEEN
upvoted 64 times
Amuzinde
4 years ago
I think so too
upvoted 5 times
...
...
Maelly
Highly Voted 3 years, 11 months ago
Shouldn't there be a SUM before Sales[Sales] ?
upvoted 18 times
Lvers
3 years, 9 months ago
If summarisation is set to sum standard for the sales measure it is not necessary.
upvoted 1 times
...
...
QWERTYman
Most Recent 2 years, 9 months ago
Answer Calculate Datesbetween
upvoted 1 times
...
Mazarakis
2 years, 9 months ago
correct answer : CALCULATE and DATEBETWEEN. The first argument of calculate Sales[sales] it might be a measure that's why it does not need a function for the first argument.
upvoted 1 times
...
edriska1
2 years, 9 months ago
7/11/22 was on exam calculate and datebetween
upvoted 1 times
...
Shan
3 years, 4 months ago
In exam 30/12/21
upvoted 1 times
...
TapZxK
3 years, 4 months ago
Could someone explain why sameperiod won't work?
upvoted 2 times
WW219
3 years, 4 months ago
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax it only takes one argument
upvoted 2 times
...
...
aet1988
3 years, 6 months ago
Had this question on today’s exam 18 Oct, Question been modified to three answers
upvoted 1 times
Chibu
3 years, 6 months ago
What options were given?
upvoted 2 times
...
...
tramynt
3 years, 9 months ago
Calculate and datebetween Because they already calculated the corresponding date of last year
upvoted 1 times
...
lbisval
3 years, 10 months ago
VAR startyear = STARTOFYEAR ( ‘Calendar'[Date] ) – 365 VAR enddate = LASTDATE ( Sales[Date] ) – 365 RETURN CALCULATE ( SUM ( Sales[sales] ), DATESBETWEEN ( ‘Calendar'[Date], startyear, enddate ) )
upvoted 5 times
Ihueghian
3 years, 6 months ago
Correct, tested it and it only works with the sum
upvoted 1 times
WW219
3 years, 4 months ago
No. In a DAX formula of PBI, the "Sales[sales]" could be refering to a measure not a column Which will then work perfectly.
upvoted 2 times
cortado
3 years, 4 months ago
But how do you know/assume "Sales[Sales]" is a measure instead of a column in this context?
upvoted 2 times
...
...
...
...
PEAKSvalleys
3 years, 10 months ago
Based on the options provided, it has to be CALCULATE and DATESBETWEEN. The DAX syntax is a bit confusing here because 'Sales'[Sales] looks like a fully qualified column reference but it could also be a measure reference. I assume that it's a measure reference because the SUM function alone doesn't allow other arguments beyond the column reference, so we wouldn't even have to ability to add in additional parameters or functions. Using CALCULATE with the measure reference ('Sales'[Sales]) then allows you to modify the calculation in a filter context with DATESBETWEEN the date range between the two variables.
upvoted 4 times
...
KNG
3 years, 10 months ago
Sum and Datebetween
upvoted 1 times
...
mrtnr
3 years, 11 months ago
There must be a sum function to calculate the total sales. CALCULATE( sum(sales), datesbetween(start, end))
upvoted 7 times
Canary_2021
3 years, 10 months ago
Agree! Sum is missing from this question.
upvoted 2 times
...
...
avyan90
3 years, 12 months ago
it should be calculate and sameperiolat year
upvoted 1 times
...
Christopher71230
3 years, 12 months ago
I thank too
upvoted 2 times
...
DeathCaliberKnight
3 years, 12 months ago
answer is wrong calculate , sameperiodlastyear , no specified period exist example: last year till today
upvoted 1 times
Massy
3 years, 12 months ago
but in the answer we have already the variables...
upvoted 2 times
...
Amuzinde
3 years, 11 months ago
We have variables start and enddates. please take note
upvoted 2 times
...
...
Amuzinde
4 years ago
Correct Answer
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