The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
19 | |
18 | |
15 | |
11 |
User | Count |
---|---|
36 | |
34 | |
19 | |
19 | |
14 |