Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
indhu
Helper III
Helper III

Exponent calculation

Hi all, 

 

I have a column decimal with varying powers say 0,10,18,28 etc. Another column amount, which contains different values. My task is to create a new column which does the following function,

 

New column = if decimal <> 0 then (0.05*amount)/10^decimal 
else (0.05*amount)/10

I can't figure out how to do this. Creating a measure with exp option provides a feature to use an exponential function with a specific number only. I would like to generate exponential value for a column and perform the above operation. 

 

Can somebody help me in pointing out in the right direction?

 

Thanks,

Indhu.

1 ACCEPTED SOLUTION

Hi @indhu,

 

In power query, we can add a custom column using the formula as below.

Custom = if [decimal]<>0 then 0.05*[amount]/Number.Power(10,[decimal]) else 0.05*[amount]/10

 

Here is the result as we excepted.

 

2.png

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/srngkyf65xim33h/Exponent%20calculation2.pbix?dl=0

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
alvin_alpha
Frequent Visitor

anyone worked with exponent calculation using calculated columns orr measures?

v-frfei-msft
Community Support
Community Support

Hi @indhu,

 

I entered a table as you descried and create a new column as below to meet your requirement.

 

Column = IF(Table1[decimal]<>0 , (0.05*Table1[amount])/10^Table1[decimal],0.05*Table1[amount]/10)

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/384kq8rkcccaple/Exponent%20calculation.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft,

 

Thanks frank.

 

This is a calculated column, right? Is there any way to generate the same result in a custom column?

 

Thanks,

Kanthi.

Hi @indhu,

 

In power query, we can add a custom column using the formula as below.

Custom = if [decimal]<>0 then 0.05*[amount]/Number.Power(10,[decimal]) else 0.05*[amount]/10

 

Here is the result as we excepted.

 

2.png

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/srngkyf65xim33h/Exponent%20calculation2.pbix?dl=0

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.