TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #2959 6.58K
๐Ÿš€ Power BI Interview Challenge #4 ๐Ÿ”ฅ

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

You have a Sales table with the following columns:
Product
Sales

Create a DAX measure to calculate the percentage contribution of each product to total sales.

๐— ๐—ฒ: Challenge accepted! ๐Ÿ’ช

Sales Contribution % =
DIVIDE(
[Total Sales],
CALCULATE(
[Total Sales],
ALL(Sales[Product])
),
0
)

๐Ÿ’ก Explanation:
This measure calculates how much each product contributes to the total sales.
โ€ข [Total Sales] returns the sales for the current product.
โ€ข ALL(Sales) removes the product filter while keeping other filters intact.
โ€ข CALCULATE() recalculates the total sales after removing the product filter.
โ€ข DIVIDE() safely performs the division and avoids divide-by-zero errors.

This challenge tests your understanding of:
โœ… CALCULATE()
โœ… ALL()
โœ… DIVIDE()
โœ… Filter Context
โœ… Percentage Calculations

๐ŸŽฏ Expected Output Example
Product | Sales | Sales Contribution %
Laptop | 50,000 | 50%
Mouse | 20,000 | 20%
Keyboard | 15,000 | 15%
Monitor | 15,000 | 15%

๐Ÿš€ Bonus (Dynamic Percentage by Selected Filters)

Sales Contribution % =
DIVIDE(
[Total Sales],
CALCULATE(
[Total Sales],
ALLSELECTED(Sales[Product])
),
0
)

Using ALLSELECTED() respects slicers and page filters while removing only the product filter, making the measure more interactive.

๐Ÿš€ Tip for Power BI Job Seekers:
Understanding the difference between these functions is crucial for interviews:
โ€ข ALL() โ†’ Removes all filters from the specified column or table.
โ€ข ALLSELECTED() โ†’ Respects user selections made through slicers and filters.
โ€ข REMOVEFILTERS() โ†’ Modern alternative to remove filters in many scenarios.

These are among the most frequently asked DAX concepts in Power BI interviews.

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

โค๏ธ React with โค๏ธ for more Power BI interview challenges!
  • โค 14
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 โ†’