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
cylo
Frequent Visitor

Measure that takes in only specified filter context

Hi,

 

I need some help in creating a measure that would always show the total_weights based on the two active filters selected, i.e., mpId and riskProfile. See snapshot below for context. Currently, my total_weights measure is showing the right number (i.e., 70% based on my snapshot below) when both active filters are applied. However, the measure value is refreshed when I select a row in the table visual (e.g., The measure is updated as 10% if I select acId = 10921081 from the table visual). Is there a way to create a measure that takes in only the 2 active filters (mpId and riskProfile) and ignores the rest? 

Screenshot 2025-04-23 140959.png

total_weights =
CALCULATE
(
    SUM(mp_mix[percent]),
    ALLSELECTED(mp_mix)
)
1 ACCEPTED SOLUTION

@cylo 

First of all Percentage is a Non aditive measure. It cannot be summed up. It should be calculated inside in a measure itself.

Now, the eaisest option is which @sjoerdvn  mentioned.--> Turned off the Edit interaction.

In dax, You need to igonore the filters from acid column .
Below code can work for you.

total weight = 
CALCULATE(
    SUM( 'Table'[Percent] ),
ALLEXCEPT('Table','Table'[Cateory],'Table'[RiskProfile])
)

 

Below screenshot

sanalytics_0-1745398577981.png

Attaching the pbix file for your reference.

 

Hope it helps

 

Regards

sanalytics

 

View solution in original post

4 REPLIES 4
sjoerdvn
Super User
Super User

I would not change the measure, but edit the interactions on the report page.

@cylo 

First of all Percentage is a Non aditive measure. It cannot be summed up. It should be calculated inside in a measure itself.

Now, the eaisest option is which @sjoerdvn  mentioned.--> Turned off the Edit interaction.

In dax, You need to igonore the filters from acid column .
Below code can work for you.

total weight = 
CALCULATE(
    SUM( 'Table'[Percent] ),
ALLEXCEPT('Table','Table'[Cateory],'Table'[RiskProfile])
)

 

Below screenshot

sanalytics_0-1745398577981.png

Attaching the pbix file for your reference.

 

Hope it helps

 

Regards

sanalytics

 

Thanks, the suggested DAX expression works for me. Toggling with the interactions wouldn't work in this case since I need that measure for other downstream calculations. 

bhanu_gautam
Super User
Super User

@cylo  ,If you want to remove all filters except for mpId and riskProfile, you can use the ALL function combined with KEEPFILTERS to keep only the desired filters:

DAX
total_weights =
CALCULATE(
SUM(mp_mix[percent]),
ALL(mp_mix),
KEEPFILTERS(mp_mix[mpId]),
KEEPFILTERS(mp_mix[riskProfile])
)

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.