Hi,
I have the following Dax Formula which is not returning the expected Result:
Solved! Go to Solution.
Thx for the reply.
Made a mistake in my explanation. It should be 2 or 3.
Somehow when I changed my logic to Equal blank () or 0 it worked. Dunno if the <> operator was reading it the wrong way.
The 2nd if statement in your code is checking for current benefits being 2 or 3, but in your explanation you are checking for it to be 1 or 2. Try
Dev. -1 month Benefits On Track KPI =
VAR _PreviousMonthBenefitsOnTrackKPI =
CALCULATE (
SUM ( Initiatives[Benefits on track] ),
Initiatives[Snapshot type] = "End of month",
HistoricalDatesInitiatives[Month relative today] = -1
)
VAR _CurrentBenefitsOnTrackKPI = [Current Benefits On Track KPI]
RETURN
IF (
NOT ( _PreviousMonthBenefitsOnTrackKPI IN { 1, 2, 3 } )
&& _CurrentBenefitsOnTrackKPI = 1,
1,
IF (
NOT ( _PreviousMonthBenefitsOnTrackKPI IN { 1, 2, 3 } )
&& _CurrentBenefitsOnTrackKPI IN { 1, 2 },
-1,
_PreviousMonthBenefitsOnTrackKPI - _CurrentBenefitsOnTrackKPI
)
)
Thx for the reply.
Made a mistake in my explanation. It should be 2 or 3.
Somehow when I changed my logic to Equal blank () or 0 it worked. Dunno if the <> operator was reading it the wrong way.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!