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.
Hello everybody,
I want to calculate the logarithm of a division (close/prev-closing). The following columns are relevant for this: Date, Close, PreviousClose, PreviousDate. The general change in % can be calculated using the formula "(Close / Prev_Closing) -1". In my case I would now like to calculate the logarithm. In Excel, the formula would be: ln(Close / Prev_Closing). The formula in Power BI "DailyChangeLN = ln (divide (Fact_Stocks [Close]; Fact_Stocks [Prev_Closing]))" unfortunately gives me ERROR with the error: 'An Argument of Function Ln has wrong data type or result is too small or too large '. Why is that?
Best regards, hwoehler
Solved! Go to Solution.
LN only working for non zero positive numbers. I checked and changed formula like this and it is working
DailyChange LN = if(Fact_Stocks[DailyChange]<>0, ln(abs(Fact_Stocks[DailyChange])))
Check file at same location
Check both are of decimal data type. Try new column like
new column = divide(table[Close] ,table[Prev_Closing]) -1
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hi @amitchandak,
thanks for your quick reply. Unfortunately it doesn't work. Both Columns (Close and Prev_Closing) are of the decimal number data type. Maybe you have time to have a closer look at my file: https://we.tl/t-wizGGyNNix
Regards, hwoehler
I added this one and it worked
DailyChangeLN = DIVIDE(Fact_Stocks[Close],Fact_Stocks[Prev_Closing])-1
Refer :https://www.dropbox.com/s/fn97mbhbxzxzpbr/Korrelation.pbix?dl=0
Hi @amitchandak,
you're right. This is the formula, which already worked before. As i mentioned in the text ("In my case I would now like to calculate the logarithm.") i want to calculate the logarithm of the division. There is the Error.
Do you have a hint?
Regards,
LN only working for non zero positive numbers. I checked and changed formula like this and it is working
DailyChange LN = if(Fact_Stocks[DailyChange]<>0, ln(abs(Fact_Stocks[DailyChange])))
Check file at same location
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 |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |