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 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
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |