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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
farah2016
Frequent Visitor

Log transformation of variables

Hey guys I am trying to use log to transform one of my variables. I have done this in R previoulsy:

m5$logv1 <- log(m5$v1)

 

Any suggestions re: how I can accomplish this ? I thought I could do it directly using R script through the Query Editor but It doesn't recognize m5 as my object name. 

 

Caution- very new to power bi.

 

Thanks!

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

Not sure what you m5 is, is that a data frame or something? In any event, in R Script, usually "dataset" holds your data frame. Also, not sure why you would need to use R to transform your data, M has Number.Log and Number.Log10 functions and DAX has LOG and LOG10 functions.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

m5 is the dataset. And just figured out how I can log each column through the Scientific transformation under Add Column ribbon. 

 

Thanks!

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Not sure what you m5 is, is that a data frame or something? In any event, in R Script, usually "dataset" holds your data frame. Also, not sure why you would need to use R to transform your data, M has Number.Log and Number.Log10 functions and DAX has LOG and LOG10 functions.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

m5 is the dataset. And just figured out how I can log each column through the Scientific transformation under Add Column ribbon. 

 

Thanks!

Hi @farah2016,

 

According to your description, it seems that you find the solution, right? If that is a case, would you please mark a helpful reply as an answer to close the thread? If not, please feel free to let me know.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors