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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
55 | |
26 | |
23 | |
15 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
18 | |
12 |