Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
hi all,
please check what is the problem as I failed to understand it as I have copied this code from a video to implement with little modifications: Video Guide Link
the Data is date wise dollar price and wants to have % Change.
screenshot:
the code:
Pct Change =
VAR CurrentValue = CALCULATE(VALUES('Big Mac Index'[dollar_price]))
VAR PreviousValue =
SWITCH(
TRUE(),
ISINSCOPE('CalDates'[Date], CALCULATE(VALUES('Big Mac Index'[dollar_price]), DATEADD('CalDates'[Date], -1, DAY))
)
RETURN
DIVIDE(
CurrentValue - PreviousValue,
PreviousValue
)
regards
Solved! Go to Solution.
I use daxformatter, it also format the dax code and give you pointer loacation about the error happened
https://www.daxformatter.com/
You can also download the dax tools from sql bi webite to work offline
Hi @Anonymous
You are missing a closing parenthesis , so the formula will report an error .
You can use the daxformatter to format the dax code and check the location of error .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , I think missing parenthesis causing this
Pct Change =
VAR CurrentValue = CALCULATE(VALUES('Big Mac Index'[dollar_price]))
VAR PreviousValue =
SWITCH(
TRUE(),
ISINSCOPE('CalDates'[Date]), CALCULATE(VALUES('Big Mac Index'[dollar_price]), DATEADD('CalDates'[Date], -1, DAY))
)
RETURN
DIVIDE(
CurrentValue - PreviousValue,
PreviousValue
)
thanks a lot @amitchandak for help 🙂 what experts are using to debug / check find error? is there any tool or its your great Brain and experiences? if any tool, can you please share the name with us?
regards
I use daxformatter, it also format the dax code and give you pointer loacation about the error happened
https://www.daxformatter.com/
You can also download the dax tools from sql bi webite to work offline
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.