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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TRK
Helper II
Helper II

How can I keep page filters acitive - using a measure that calculates a grand total?

Hi,

 

I currently have a page filter that filters out one country in the Country of Origin column.

 

I need to calculate a % of the a total number of samples that come from any one country, or program, etc., selected on the dasboard visualizations against the total unfiltered samples (excluding the one country I filtered out using the page filter) .

 

I want the the total unfiltered samples is the same amount no matter which filters are applied on the dashboard (such as program) - excluding the page filter for the one country.

 

I have been experimenting with CALCULATE AND ALL functions - but it is not working - I realize the last "ALL" for country lookup would be discounting all filters on country - not sure what function I could use to keep the page filter active or a method that would do the equivelant.

 

unfiltered samples = CALCULATE('sample data'[sum samples],

                                   ALL ('Program Lookup'[Program]) ,

                                   ALL ('Country Lookup'[Country of Origin]))

 

 

My goal :  % of samples = [sum samples]/[unfiltered samples]

 

any suggestions are appreciated.

 

-TRK

1 ACCEPTED SOLUTION

Unfortunately "ALLEXCEPT" ends up filtering out all countries in the total counts.  I want to keep all the countries in the "country of origin" column, except the one country I filtered out on the page filter (this allows me to filterout domestic vs. imported samples).

 

Any other ideas?

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

I believe you want to use ALLEXCEPT.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Unfortunately "ALLEXCEPT" ends up filtering out all countries in the total counts.  I want to keep all the countries in the "country of origin" column, except the one country I filtered out on the page filter (this allows me to filterout domestic vs. imported samples).

 

Any other ideas?

Hi,

 

I realized I had a relationship line missing.  I went back and tried ALLEXCEPT again.  It worked.

 

Thank-you!

Hi @TRK,

 

>>Any other ideas?

I'd like to suggest you use "ALLSELECTED" to instead the "ALL" function.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.