Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
s--turn
Helper II
Helper II

REMOVEFILTERS, ALLEXCEPT, ALL etc not working as expected

Hello,

I'm trying to do something that should be so simple...  I want to get the table below.  For my measures, I have the following:

 

measure1 = DISTINCTCOUNT(contacts[individualid])

measure2 = CALCULATE([measure1],ALLSELECTED(AgeBands[Age Band]))

measure3 = [measure1]/[measure2]

 

I'm happy that measure1 and measure3 are doing what they should, but measure2 is just giving me the same numbers as measure1, instead of giving me the total number of contacts in that region.  Annoyingly, I can easily get measure3 by using "% of column total" in a matrix visual, but I can't do that in a line chart, which is what I ultimately want to have.  My measure3 is currently just giving me 100% as measure1 and measure2 are identical.

 

My table visual is filtered on Region (there are other regions that I don't want to show in this analysis), and also one other field (let's call it Customer Type).  I've tried what feels like every permutation of ALL, ALLEXCEPT, ALLSELECTED, KEEPFILTERS, REMOVEFILTERS... I keep getting the same results.  Help!

 

Age BandRegion(measure1) - total contacts(measure2) - total contacts disregarding age band(measure3) - % of contacts in this region who fall into this age band
Under 20South2010020%
Under 20North405090%
Under 20West620

30%

 

4 REPLIES 4
s--turn
Helper II
Helper II

Any ideas, anyone?   I still don't understand why this isn't working as expected. 

s--turn
Helper II
Helper II

Oh, and the age bands table is related to the contacts table - but I've also tried having a field for age bands on the contacts table itself (adding it in Power Query) and had the same problems.

Hi @s--turn ,

 

Another way to be independent of slicers is to create a calculated column. Here are the steps.

Create a measure.

Measure =
DISTINCTCOUNT ( AgeBands[individual id] )

Create two columns.

Column 1 =
CALCULATE (
    DISTINCTCOUNT ( AgeBands[individual id] ),
    FILTER ( 'AgeBands', 'AgeBands'[Region] = EARLIER ( AgeBands[Region] ) )
)
Column 2 =
DIVIDE ( [Measure], 'AgeBands'[Column 1] )

And you can also put them in a line chart.

Final output:

vxiaosunmsft_0-1669274887776.png

 

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xiaosun-msft , thank you for replying.  I@ve tried that technique but unfortunately it still doesn't quite do what I need.  Please see images below.  The line chart, at first glance, looks better (Region is on the Legend), but when I convert it into a matrix, I can see that the figures for each Region do not add up to 100%.  What I'm trying to show is the relative distribution of ages in each region, so that we can say (for example) that Region X has a younger profile than Region Y.  

Screenshot 2022-11-24 124409.pngScreenshot 2022-11-24 124429.png

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.