Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
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 (?) , you can switch to a simple comment.
Switch to a voting comment New
MonikaStop
Highly Voted 2 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 6 times
...
Jayaruwan
Highly Voted 2 months, 1 week ago
Selected Answer: A
Answer A is correct because Dateadd provides required set of dates
upvoted 5 times
1CY1
2 months ago
A is simple and I can't see whats wrong with it. -> Ans : A
upvoted 1 times
1CY1
1 month, 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 day, 4 hours 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 1 times
...
3433bf6
1 month, 1 week ago
Selected Answer: B
B DATESBETWEEN as DATEADD returns only 1date while we need a series of dates.
upvoted 2 times
...
MonikaStop
1 month, 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
1 month, 3 weeks ago
I thought A would just give you a single day 30 days earlier. -> Ans : B
upvoted 1 times
...
...
shedi13
2 months ago
I would say A, but after testing im certain thats B
upvoted 3 times
...
b92fc92
2 months, 1 week ago
Selected Answer: B
B in my opinion
upvoted 1 times
...
Monsta
2 months, 2 weeks ago
Selected Answer: B
B is the right answer.
upvoted 2 times
...
b9e3c84
2 months, 2 weeks ago
Selected Answer: A
The expresion B Max(Date[]-30) is wrong
upvoted 2 times
...
nelrosell
2 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 ...