Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
User | Count |
---|---|
54 | |
23 | |
19 | |
18 | |
17 |
User | Count |
---|---|
91 | |
86 | |
46 | |
28 | |
22 |