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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
s--turn
Helper I
Helper I

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 I
Helper I

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

s--turn
Helper I
Helper I

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.