exam questions

Exam PL-300 All Questions

View all questions & answers for the PL-300 exam

Exam PL-300 topic 2 question 97 discussion

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

You have a Power BI model that contains two tables named Sales and Date. The Sales table relates to the Date table by using a many-to-one relationship. The Sales table contains the following columns:

• Date
• Product
• SalesAmount

You need to create a DAX measure for a rolling 31-day sales total that will return the total sales amount for a selected date and the previous 30 days.

Which DAX expression should you use?

  • A. CALCULATE(SUM(Sales[SalesAmount]), DATEADD(Date[Date], -30, DAY))
  • B. CALCULATE(SUM(Sales[SalesAmount]), DATESBETWEEN(Date[Date], Max('Date'[Date])-30, Max('Date'[Date])))
  • C. CALCULATE(SUM(Sales[SalesAmount]), DATESMTD(Date[Date]))
  • D. CALCULATE(SUM(Sales[SalesAmount]), DISTINCTCOUNT(Date[Date]) = 31)
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
MonikaStop
Highly Voted 3 months ago
Selected Answer: B
DATESBETWEEN creates a continuous range of dates from the selected date back 30 days. So option B is more suitable for calculating a rolling 31-day total because it correctly defines the date range needed for the calculation.
upvoted 8 times
...
Jayaruwan
Highly Voted 3 months, 2 weeks ago
Selected Answer: A
Answer A is correct because Dateadd provides required set of dates
upvoted 5 times
tko86
6 days, 10 hours ago
A. CALCULATE(SUM(Sales[SalesAmount]), DATEADD(Date[Date], -30, DAY)): This is incorrect because DATEADD shifts the entire date context by 30 days. It doesn't create a range of dates. It would calculate the sales for the single day 30 days prior to the currently filtered date, not for the 31-day period.
upvoted 1 times
...
1CY1
3 months ago
A is simple and I can't see whats wrong with it. -> Ans : A
upvoted 1 times
1CY1
2 months, 1 week ago
Changed mind... I thought A would just give you a single day 30 days earlier. -> Ans : B
upvoted 1 times
...
...
...
jaume
Most Recent 1 month ago
Selected Answer: B
DATEADD would return the selected date shifted back 30 days not a period. DATESBETWEEN will return the desired period for the calculation
upvoted 2 times
...
3433bf6
2 months, 1 week ago
Selected Answer: B
B DATESBETWEEN as DATEADD returns only 1date while we need a series of dates.
upvoted 2 times
...
MonikaStop
2 months, 4 weeks ago
Selected Answer: A
I changed my mind, Max(Date[Date]-30) will not work, so I would go with DATEADD
upvoted 1 times
1CY1
2 months, 3 weeks ago
I thought A would just give you a single day 30 days earlier. -> Ans : B
upvoted 1 times
...
...
shedi13
3 months ago
I would say A, but after testing im certain thats B
upvoted 3 times
...
b92fc92
3 months, 1 week ago
Selected Answer: B
B in my opinion
upvoted 1 times
...
Monsta
3 months, 2 weeks ago
Selected Answer: B
B is the right answer.
upvoted 2 times
...
b9e3c84
3 months, 2 weeks ago
Selected Answer: A
The expresion B Max(Date[]-30) is wrong
upvoted 2 times
...
nelrosell
3 months, 2 weeks ago
A is the correct answer
upvoted 1 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