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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
MichelleQLi
Regular Visitor

Two Slicers in one Page How to use All or Allexcept or Allselected properly

Dear Experts,

 

I have a fact table "FT-Mitre10"  (plese see below picture/snapshot for details).


My Power BI sheet has two filters on the same page:

 - Category

 - Rate Captured (which is Date)

 

I just feel confused how to use filter funtion to make two filters working at the same time.

Below is my current failed funtions:

M91 = CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER(ALLSELECTED('FT-Mitre10'[Category]), MIN('FT-Mitre10'[Rate Captured])))
M92 = CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER('FT-Mitre10', 'FT-Mitre10'[Rate Captured]= MIN('FT-Mitre10'[Rate Captured])))
M93 = CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER(ALL('FT-Mitre10'), 'FT-Mitre10'[Rate Captured] = MIN('FT-Mitre10'[Rate Captured])))
M94 = CALCULATE('FT-Mitre10'[M91], FILTER(ALL('FT-Mitre10'), 'FT-Mitre10'[Rate Captured] = MIN('FT-Mitre10'[Rate Captured])))

 

My Expectation is:

 

M91 is a fixed rate, showing single item rate on the earliest date (which is 2022/03/18 rate in this case).

Won't be affected by Date filters. But currently, it changes when I select on different date.

I tried to use All function to fixed date, which is my current M93.

However, it makes my rate no longer single item rate but an average rate of all items, which is not what I expected.

I want a single item rate but the date is the earliest date of All Table rather than earliest date of Date Filter.

M94 is me tried to use two nested filter to get rid of ALL function, I thought M91 result gonna be single item rate, then I can use ALL only to control date filter. But failed, seems ALL still will control all....

 

 

M92 is a non-fixed rate, showing single item rate on the earliest selected date.

Will be affected by the Date filter.

Will be affected by the Category filter.

Currently, it seems working fine as I expected. But I don't get the difference of my current M91 and M92.

Under what circumstances those two measures will show different result?

 

 

powerbi question 20220624.jpg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@MichelleQLi , Based on what I got

 

M91 =
Var _min = minx(all('FT-Mitre10') , 'FT-Mitre10'[Rate Captured])
return
CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER(all('FT-Mitre10'), 'FT-Mitre10'[Rate Captured] =_min ))


M92 =
Var _min = minx(allselected('FT-Mitre10') , 'FT-Mitre10'[Rate Captured])
return
CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER('FT-Mitre10', 'FT-Mitre10'[Rate Captured] =_min ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

7 REPLIES 7
powerbi_zone
Frequent Visitor

We need to clearly understand the diffrence between ALL ,ALLSELECTED and ALLEXCEPT and then how to use them .

If i try to explain everything in this blog post it comes too lengthy .Found one of the best videos which clearly gives the difference with a single example that clears all the confusion .Hope this helps .Cheers !

https://www.youtube.com/watch?v=aVVua4fG1V0 

amitchandak
Super User
Super User

@MichelleQLi , Based on what I got

 

M91 =
Var _min = minx(all('FT-Mitre10') , 'FT-Mitre10'[Rate Captured])
return
CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER(all('FT-Mitre10'), 'FT-Mitre10'[Rate Captured] =_min ))


M92 =
Var _min = minx(allselected('FT-Mitre10') , 'FT-Mitre10'[Rate Captured])
return
CALCULATE(AVERAGE('FT-Mitre10'[Rate]), FILTER('FT-Mitre10', 'FT-Mitre10'[Rate Captured] =_min ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

powerbi question 20220625 - M91-5 Effect 3.jpg

powerbi question 20220625 - M91-5 Effect 2.jpg

powerbi question 20220625 - M91-5 Effect 1.jpg

Hi Amit, 

 

Regarding the M91, I tried your solution, it doesn't work well as I believe it is the ALL function still holding highest priority and calculate all information from the table. However I have made a M91-5 to work it out. Please see below snapshot for more details.

 

powerbi question 20220625 - M91-4 Solution Problem.jpg

Hi  ,  

Big thanks for your M92 which is more concise and clear than mine. I totally accept your solution.

 

Ngā mihi | Kind Regards,

 

Michelle Q Li

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.