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
Anonymous
Not applicable

if() based measure not filtering or slicing

I have a measure with 4 variables, the final product of which (FixedBooleanValue) is to return a true if 0, otherwise false.

All four variables before the return will filter by organisation correctly if turned into their own measures, and it is only the final measure that appears to disregard when filtered.

Relationships here are:

 

Agreement[AgreementKey] 1 - * Agreement Conditions[AgreementKey]

Calendar[DateKey] 1 - * 'Agreement Conditions'[DateKey]

Organisation[OrganisationKey 1 -* 'Agreement Conditions'[OrganisationKey]

 

The measure is:

Discount Fixed Boolean:= 
var Margin = calculate(
    average('Agreement Conditions'[Discount Margin Pct])
    ,lastnonblank('Calendar'[ActualDate],average('Agreement Conditions'[Discount Margin Pct]))
    )
var Minimum = calculate(
    average('Agreement Conditions'[Discount Minimum Pct])
    ,lastnonblank('Calendar'[ActualDate],average('Agreement Conditions'[Discount Minimum Pct]))
    )
var BaseRate = calculate(
    average('Agreement Conditions'[Discount Base Rate Pct])
    ,lastnonblank('Calendar'[ActualDate],average('Agreement Conditions'[Discount Base Rate Pct]))
    )
var FixedBooleanValue = Margin+Minimum+BaseRate
return
if(FixedBooleanValue = 0, true, false)

So for some reason filter contexts are not applied for the final if() and appears to behaving like something akin to a cross-join, as all agreement keys are appearing next to all organisations.

I would be grateful to be shown where I am going wrong.

0 REPLIES 0

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.