#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Interview Insights · Power BI

The Power BI Question That Ninety Percent of Candidates Fumble

'Show each category as a percentage of total sales, and make it add up to 100% even when the user filters regions with a slicer.' The first half is easy. The second half is where most candidates I interview stumble, because it depends on ALL versus ALLSELECTED.

Tracks
The % of Total Test Interactive
Denominator
—
Which filter it removes
Slicer: North
—
What the total becomes
Rows add to
—
Sum of the % column
Measure→Slicer→Denominator→Percent
Click a denominator to see how it reacts when a Region slicer is set to North, and whether the percentages in the visual still add up to 100%.

Home / Tutorials / Career Guides / The Power BI Question That Ninety Percent of Candidates Fumble

Interview Insights · Power BI

The Power BI Question That Ninety Percent of Candidates Fumble

NUMERATORCHOICESLICERRESULTSales hereAll filters onthis cell applyEasyRemove what?Every filter orjust the rowsTrapUser filtersRegion, year,segmentTestAdds to 100?Depends onthe functionVerdict
The numerator follows every filter. The question is which filters the denominator should ignore, and that choice decides whether the percentages add up.

Quick summary — Power BI % of total

The fumble is not about DIVIDE; it is about deciding exactly which filters the denominator should ignore. Almost everyone can write a percentage measure that works on an unfiltered page. The trouble starts when a slicer is applied. ALL on the whole table ignores the slicer, so percentages no longer add to 100%. ALL on one column removes only that column's filter. ALLSELECTED respects filters from slicers outside the visual. Interviewers ask this question because the right answer depends on what the business wants, and only someone who understands filter context can ask the right clarifying question.

In this guide you will learn:

  1. The exact question and the denominator choices candidates make
  2. How ALL, REMOVEFILTERS and ALLSELECTED behave when a slicer changes
  3. Which clarifying question to ask before writing the measure
  4. Follow-ups on ranking, running totals and year-over-year change
  5. A test routine to prove your measure in a table visual

SECTION 01The question, and why the first answer usually breaks

I usually set it up like this. There is a Sales fact table, a Product dimension with Category, and a Region dimension. On the page is a table visual with Category and Total Sales, and a Region slicer. Add a column showing each category's share of total sales.

Most candidates write a measure quickly and test it with nothing selected in the slicer. It shows sensible percentages that add up to 100%. Then I select North in the slicer. In many cases the percentages drop and add up to something much smaller. The candidate has used ALL on the entire table, so the denominator still includes every region.

Denominator usedFilters it removesWith Region = NorthDo rows add to 100%?
CALCULATE([Sales], ALL(Sales))Every filter on the Sales table and its related dimensionsTotal of all regionsNo, they add to North's share of all sales
CALCULATE([Sales], ALL('Product'))Every filter from the Product tableNorth total, all categoriesYes, for North
CALCULATE([Sales], REMOVEFILTERS('Product'[Category]))Only the Category column filterNorth total, all categoriesYes, for North
CALCULATE([Sales], ALLSELECTED('Product'[Category]))Category filter from the visual, keeps outer selectionsTotal of selected categories in NorthYes, of what the user selected
Total Sales = SUM ( Sales[Amount] )

Category % (Breaks) =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], ALL ( Sales ) )
)

No slicer selection:
Bikes 60%  Accessories 25%  Clothing 15%   = 100%

Region slicer = North (North is a third of sales):
Bikes 20%  Accessories 8%  Clothing 5%     = 33%

Why: ALL ( Sales ) removes every filter that reaches
the Sales table, including the Region filter coming
through the relationship. The denominator is still
the whole company.
category-share.dax

The example percentages above are illustrative, not from a real dataset. What matters is the pattern: with ALL on the fact table, the percentages shrink when a slicer is applied, because the denominator never changes.

Key insight: Every percent-of-total measure answers the question 'percent of what?'. Your filter-removal function is the answer to that question, so choose it deliberately.

SECTION 02ALLSELECTED, and the clarifying question to ask first

The strongest candidates do not start typing straight away. They ask a clarifying question: if the user filters the visual to only some categories, should the remaining ones add up to 100%, or should they show their share of all categories?

That question matters because both answers are reasonable. A sales manager comparing a few selected categories may want them to add to 100%. A finance team may want each category's share of the full business, even when only some are shown. ALLSELECTED handles the first case; REMOVEFILTERS handles the second.

Business wantsFunction to useBehaviour when user picks 2 of 3 categoriesTypical use
Share of everything in the current regionREMOVEFILTERS('Product'[Category])Two rows that add to less than 100%Contribution to region total
Share of only what is selectedALLSELECTED('Product'[Category])Two rows that add to 100%Comparing a chosen subset
Share of the whole company alwaysREMOVEFILTERS('Product'[Category], Region)Ignores region and category selectionsCompany-wide contribution
Share of the parent subcategoryREMOVEFILTERS on SubCategory onlyEach product's share within its subcategoryDrill-down matrices
Category % of Selected =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], ALLSELECTED ( 'Product'[Category] ) )
)

Setup: Region slicer = North,
       Category slicer = Bikes, Clothing

Category % (REMOVEFILTERS):
Bikes 61%   Clothing 15%   -> adds to 76%

Category % of Selected (ALLSELECTED):
Bikes 80%   Clothing 20%   -> adds to 100%

ALLSELECTED removes the filter coming from the
visual's rows, but keeps the selections made in
slicers and filters outside the visual.
allselected.dax

Asking this question takes fifteen seconds, and it changes how the interviewer sees the rest of your answer. You are no longer a candidate trying to recall a formula. You are an analyst clarifying a requirement, which is the actual job.

Remember: ALLSELECTED respects what the user selected outside the visual. REMOVEFILTERS ignores the named filter completely. If you can say that in one sentence, you have understood the question.

SECTION 03The follow-ups that use the same filter logic

Once the percentage works, I usually ask one or two follow-ups that rely on the same skill: changing the filter context for one part of a calculation while keeping the rest. If you understood the percent-of-total answer, these feel natural. If you memorised it, they feel like new problems.

The three that come up most are ranking categories, a running total over dates, and year-over-year growth. Each one removes or shifts a filter in a specific way.

Follow-upFilter change neededKey functionCommon slip
Rank categories by salesCompare against all categories, not just the current rowRANKX over ALL('Product'[Category])Ranking over the current row only, so every rank is 1
Running total by dateInclude all dates up to the current oneCALCULATE with FILTER over ALL('Date'[Date])Forgetting to remove the date filter first
Year-over-year growth %Shift the date filter back one yearDATEADD on a marked Date tableUsing the fact table's date column
Share of the best categoryCompare each category with the maximumMAXX over ALLSELECTED categoriesHard-coding the top category
Category Rank =
RANKX (
    ALL ( 'Product'[Category] ),
    [Total Sales],
    ,
    DESC,
    DENSE
)

Running Sales =
VAR CurrentDate = MAX ( 'Date'[Date] )
RETURN
    CALCULATE (
        [Total Sales],
        FILTER (
            ALL ( 'Date'[Date] ),
            'Date'[Date] <= CurrentDate
        )
    )

-- For a running total within the current year only,
-- use TOTALYTD ( [Total Sales], 'Date'[Date] ).
filter-followups.dax

Notice the ALL inside RANKX. Without it, the ranking table contains only the category on the current row, so every category ranks first. This is the ranking version of the same mistake people make with percentages, just in the other direction.

In Uncodemy mock interviews, the follow-up we use most after this question is the RANKX one, precisely because it tests whether the candidate understands why the filter must be removed.

Pro move: After solving the percentage, say: 'The same idea, removing the Category filter, is what makes RANKX work across categories.' Linking the follow-up to the original shows real understanding.
How Uncodemy helps: At Uncodemy, the Power BI Training Course in Noida builds this into the batch: you practise Power BI interview questions in live mock interviews with trainers, get feedback on every answer, and work on real projects you can explain with confidence.

SECTION 04Test routine: prove your percent-of-total measure

Use this routine on any percentage or ranking measure before you call it done, in an interview or at work. It takes about two minutes and catches most filter mistakes.

BUILD: table visual with Category, Total Sales,
your % measure, and a total row turned on.
ADD: Region slicer and Category slicer.

Test 1  No selections       -> % adds to 100%?
Test 2  Region = North      -> % adds to 100%?
Test 3  Region = North+South-> % adds to 100%?
Test 4  Category = 2 of 3   -> adds to 100%, or not?
        Is that what the business asked for?
Test 5  Check one row by hand:
        category sales / denominator = shown %?

Write down what each test showed.
percent-of-total-tests.md

SECTION 05Habits that stop the percent-of-total fumble

These habits apply to every DAX measure that compares a value with a total, rank or earlier period.

  • Ask 'percent of what?' — Clarify whether slicer selections should change the total before you write the denominator.
  • Remove the narrowest filter — Prefer removing one column's filter over ALL on the fact table, unless the business truly wants the company total.
  • Test with a slicer selected — A percentage that looks right with nothing selected proves very little. Always test with at least one selection.
  • Turn on the total row — In a table visual, the total row for a share measure should usually show 100%. If it does not, investigate.
  • Name measures by intent — Names like 'Category % of Region' tell everyone, including the interviewer, which total you meant.
Pro tip: Book a mock interview with an Uncodemy trainer and ask for this exact question with a slicer twist. Practising the clarifying question under pressure is what makes it automatic in the real round.

SECTION 06Interview Q&A — Power BI % of total

Q1What is the difference between ALL and ALLSELECTED in DAX?

ALL removes filters from the specified table or columns completely, ignoring slicers and visual filters. ALLSELECTED removes filters coming from the current visual's rows and columns but keeps the filters the user applied through slicers and filters outside the visual. So ALLSELECTED gives the total of what the user can see.

Q2What is REMOVEFILTERS and how is it different from ALL?

REMOVEFILTERS removes filters from the given table or columns when used as a CALCULATE modifier. In that role it behaves like ALL, but it states the intent more clearly. ALL can also be used as a table function that returns rows, while REMOVEFILTERS cannot.

Q3Why does my percent of total not add up to 100% when I use a slicer?

Usually because the denominator removes the slicer's filter as well, for example with ALL on the fact table. The numerator respects the slicer but the denominator does not, so percentages shrink. Remove only the filter you need, such as the Category column, or use ALLSELECTED.

Q4Why does RANKX return 1 for every row?

Because the table argument contains only the current row's item. Inside a visual, a category row filters Product to one category, so ranking over VALUES or the filtered table gives a single item. Use ALL('Product'[Category]) or ALLSELECTED to rank across all categories.

Q5How do you calculate year-over-year growth in Power BI?

Create a previous-year measure with CALCULATE and DATEADD or SAMEPERIODLASTYEAR on a marked date table, then divide the difference by the previous year with DIVIDE. The visual must use fields from the date table so the time shift works correctly.

SECTION 07Test yourself — Power BI % of total quiz

Five questions. No sign-up.

0 / 5

Pick an answer to see why it is right or wrong.

SECTION 08Frequently asked questions

How do I calculate percentage of total in Power BI?

Divide the measure by the same measure evaluated with one filter removed: DIVIDE([Total Sales], CALCULATE([Total Sales], REMOVEFILTERS('Product'[Category]))). Choose which filter to remove based on what the total should mean, and test with slicers.

When should I use ALLSELECTED in Power BI?

Use ALLSELECTED when the total should reflect what the user has selected in slicers and filters, such as making selected categories add up to 100%. It removes filters coming from the visual itself but keeps outer selections.

What DAX questions are commonly asked in Power BI interviews?

Frequent ones include percent of total, CALCULATE and filter context, ALL versus ALLSELECTED, SUMX versus SUM, RANKX, running totals, year-over-year growth and distinct counts. Many interviews add a slicer or filter to test your understanding.

Why is my Power BI percentage wrong after filtering?

The denominator is probably removing more or fewer filters than intended. Check which function you use inside CALCULATE and test the measure in a table with the total row turned on and different slicer selections.

What is the difference between ALL and REMOVEFILTERS in Power BI?

As CALCULATE modifiers they behave the same, removing filters from the named table or columns. REMOVEFILTERS is clearer about intent, while ALL can also return a table for use in iterators like RANKX or FILTER.

Does Uncodemy help with Power BI interview questions?

Yes. Uncodemy's Power BI Training Course in Noida (classroom and online) includes live projects, one-to-one mock interviews and resume reviews, so you practise Power BI interview questions with trainer feedback before the real interview. You can book a free demo class from this page to see how the sessions work.

Classroom & online · Noida

Answer the DAX question most candidates fumble

Our Power BI Training Course teaches DAX filter context, time intelligence and ranking through hands-on reports, so percent-of-total questions become straightforward for you.

Talk to a counsellor for current fees
  • DAX filter context practice
  • Slicer test routines
  • Mock Power BI interviews
  • Weekday & weekend batches