The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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