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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
aallman
Helper I
Helper I

Measure based on Multiple Slicer Selection

Hello!

I have a measure to calculate fail rate. Right now it is actually a couple of measures: one counting all the fails, one counting the total items, and a third that does the calculation to turn the first two into a fail rate. 

What I need to be able to do is have the users select their departments in the slicers and have the measures change to only calculate the fail rate for those departments. I have found a solution using IF ISFILTERED and SELECTED VALUE

if(ISFILTERED(ALL_Fail_History[SynthDept]),'Synthesized Items'[synthDept]=SELECTEDVALUE(ALL_Fail_History[SynthDept])
but this solution doesn't seem to work when multiple departments are selected. This is necessary for my use case. 
Any ideas on how to get this to work even if two or more values are selected in the SynthDept filter?
 
 
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try something like below and check whether it works.
If you are using ALL DAX function in one of your measures, please try using ALLSELECTED DAX function.

 

ALLSELECTED function (DAX) - DAX | Microsoft Learn

 

expected result measure: =
VAR _failcount = [failcount measure]
VAR _allitemcount =
    CALCULATE ( [itemcount measure], ALLSELECTED () )
RETURN
    DIVIDE ( _failcount, _allitemcount )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

6 REPLIES 6
v-pagayam-msft
Community Support
Community Support

Hi @aallman ,
We haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.
If our response addressed your query, please mark it as Accept Answer and click Yes if you found it helpful.
If you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

v-pagayam-msft
Community Support
Community Support

Hi @aallman ,
I just wanted to kindly follow up to see if you had a chance to review the previous response provided by community members. I hope it was helpful. If yes, please Accept the answer so that it will be helpful to others to find it quickly.
Thank you.

v-pagayam-msft
Community Support
Community Support

Hi @aallman ,
May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

Thank you.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try something like below and check whether it works.
If you are using ALL DAX function in one of your measures, please try using ALLSELECTED DAX function.

 

ALLSELECTED function (DAX) - DAX | Microsoft Learn

 

expected result measure: =
VAR _failcount = [failcount measure]
VAR _allitemcount =
    CALCULATE ( [itemcount measure], ALLSELECTED () )
RETURN
    DIVIDE ( _failcount, _allitemcount )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you! That mostly solved the problem, however now I am worried that the filters aren't working correctly. I have 2 tables, one contains the fails and the other contains the total items. Each have the field that I want to filter on, but the tables are not linked. (They are related to a common date table for date filtering currently) Does this ALLSELECTED work in this case? It seems to be only letting the slicer filter the table that it is currently located in (in this case my fail table).

Hi,

Thank you for your message, and if it is OK, please share your sample pbix file's link (Onedrive link, or Dropbox link, or others), and then I can try to look into it to come up with a proper solution.

Thank you.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.