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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PriyankaJhaTheA
Helper III
Helper III

URGENT!! Filter affecting even if ALLSELECTED is used.

Hello Power BI Community, 

I need some help with the following Dax code:

 

allvalue_SingleSelect =
VAR BrandsSelection = ISFILTERED('df_brands'[Brands])
VAR TotalCount =
IF (
BrandsSelection,
CALCULATE( DISTINCTCOUNT(Respondent[Unique_ID])
, 'df_brands'[value] = "Yes", 'df_Occasions'[value1] = "Yes",
'df_Category Purchased'[value] = "Yes"
, ALLSELECTED('df_Search Order (First)'[Search Order (First)])
), CALCULATE(
DISTINCTCOUNT(Respondent[Unique_ID]), 'df_Brands'[value] IN {"Yes", "No", "", "Null"}, 'df_Occasions'[value1] = "Yes",
'df_Category Purchased'[value] = "Yes"
, ALLSELECTED('df_Search Order (First)'[Search Order (First)])
))
RETURN TotalCount


this dax measure returns the following table for example :
Search Order (First) allvalue_SingleSelect
Pack Type First 9089
Pack Type First 9089
Brand First 9089
Unit Type First 9089
Nutritional Content First 9089
Flavour Variant First 9089
Pack Size First 9089
Returnable Packaging First 9089
Category First 9089
Price First 9089
Temperature First 9089
Format First 9089
Promotion First 9089
Product Origin First 9089
Try New First 9089
Packaging Design First 9089
Others First 9089

 

but when i filter the power bi table to Search Order (First) = Pack Type First for example 

 

Search Order (First) allvalue_SingleSelect
Pack Type First 533


the value of allvalue_SingleSelect changes to 533 but it should remain as the total - 9089

how can i update the measure to get 9089 even if Search Order (First) column is filtered?

here is the sample pbix: https://drive.google.com/file/d/11FppQjqX3oQEEcPuwStBxAYBdY66i-R-/view?usp=sharing
@MFelix , @amitchandak , @Ashish_Mathur 

1 REPLY 1
Anonymous
Not applicable

Hi, @PriyankaJhaTheA 

 

You can try using the Summarize and filter functions to make Measure automatically aggregate into a static sum, independent of the slicer. Also, since your [TotalDistinctCount_Category_Occasions_SingleSelect] is also a dynamic metric and will change depending on the choice of slicer, it is recommended to create a copy of [TotalDistinctCount_Category_Occasions_SingleSelect] that is not affected by the slicer. Then go and create the [allvalue_SingleSelect] measure.

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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