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
Theodore88
Regular Visitor

cannot apply a slicer to a measure that uses calculate() with a filter

Hi

 

I am wondering if anyone can help.

I managed to create a measure that calculates the total contracts exposure using DAX formula calculate with a filter.

Even though the formula works there is no way to apply addtional filters to the measure either with a slicer or in the visual panel.(the filter parameter seems to overwrite other filters)

The below is the function I am using if needed, is there any work around to this?

 

Exposure = calculate(
sum(
Components[NetLJ]
)
,FILTER(ALL (Components),Components[DateLJ]<=max(Components[DateLJ]))

)

 

 

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@Theodore88

 

In your forumla, since you apply ALL() function in your filters, it will remove all filters. That's the reason your additional filter/slicer doesn't work. Please replace your ALL() function with ALLSELECTED(). See my sample below:

 

Exposure = CALCULATE(SUM(Table7[Value]),FILTER(ALLSELECTED(Table7),Table7[Seller]="Seller1"))

66.PNG

 

 

677.PNG

View solution in original post

1 REPLY 1
v-sihou-msft
Employee
Employee

@Theodore88

 

In your forumla, since you apply ALL() function in your filters, it will remove all filters. That's the reason your additional filter/slicer doesn't work. Please replace your ALL() function with ALLSELECTED(). See my sample below:

 

Exposure = CALCULATE(SUM(Table7[Value]),FILTER(ALLSELECTED(Table7),Table7[Seller]="Seller1"))

66.PNG

 

 

677.PNG

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.