TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #2954 5.77K
๐Ÿš€ Power BI Interview Challenge #2 ๐Ÿ”ฅ

๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„๐—ฒ๐—ฟ:
You have 2 minutes to solve this Power BI problem.

You have a Sales table with the columns: Order Date & Sales

Create a DAX measure to calculate Month-to-Date (MTD) Sales.

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช
MTD Sales =
TOTALMTD(
SUM(Sales[Sales]),
Sales[Order Date]
)

๐Ÿ’ก Explanation:
โ€ข TOTALMTD() calculates cumulative sales from the beginning of the current month up to the selected date.
โ€ข SUM(Sales) returns the total sales amount.
โ€ข Sales[Order Date] is the date column used for the MTD calculation.
โ€ข The measure automatically resets at the beginning of each new month.

๐ŸŽฏ Expected Output Example
Date | Sales | MTD Sales
Jul 1 | 2,000 | 2,000
Jul 2 | 3,500 | 5,500
Jul 3 | 1,500 | 7,000
Jul 4 | 4,000 | 11,000

๐Ÿš€ Bonus (Using a Calendar Table)
MTD Sales =
TOTALMTD(
[Total Sales],
'Calendar'[Date]
)

Using a dedicated Calendar table improves model performance and ensures accurate time intelligence calculations.

๐Ÿš€ Tip for Power BI Job Seekers:
Always create a proper Date Table and mark it as a Date Table in Power BI before using Time Intelligence functions. Many interview questions are designed to test this best practice.

Power BI Resources: https://whatsapp.com/channel/0029Vai1xKf1dAvuk6s1v22c

โค๏ธ React with โค๏ธ for more Power BI interview challenges!
  • โค 8
More from @sqlspecialist
  1. Oct 7, 2026๐Ÿ“Š Kandinsky 6.0 Video: AI-Powered Content Creation for Analysts The new Kandinsky 6.0 Vidโ€ฆ
  2. Oct 7, 2026Alternatively, depending on the Excel version and requirement, I could use functions suchโ€ฆ
  3. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 5 Guys, let's continue our Data Analyst Interviewโ€ฆ
  4. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  5. Oct 7, 2026๐Ÿ”Ÿ What is the difference between UNION and JOIN? Sample Answer: "JOIN combines columns frโ€ฆ
  6. Oct 7, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 4 Guys, let's continue our Data Analyst Interviewโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’