The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
8 | |
7 |