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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Lucian
Responsive Resident
Responsive Resident

R table - dynamic column name

Hello,

 

I need a table visual in R for wich the name of a specific colum must get a value from a measure. I'm new to R but until now I could manage to rename a colum and obtain a new name using this code:

 

 

library(gridExtra)
colnames(dataset)[colnames(dataset)=="TotalBase"] <- "NewName"

 

 

So the original name "TotalBase" was transformed into the "NewName".

But how could I pass a measure value?

Is it possible to achieve something like this?:

 

colnames(dataset)[colnames(dataset)=="TotalBase"] <- Table[Measure]

 

 

Kind Regards,

Lucian

1 ACCEPTED SOLUTION
Lucian
Responsive Resident
Responsive Resident

Hello @v-evelk

 

Thank you for the recomended materials... There are good starting points in learning R.

Until then... I hope I will get enough votes on the Improved table visual - dynamic column names ideea so it would be implemented without needing R. 😁

 

Kind Regards,

Lucian

View solution in original post

4 REPLIES 4
v-evelk
Microsoft Employee
Microsoft Employee

Hello,

 

Unfortunately, I'm not an expert of R, however I can recommend you to investigate R code of other visuals to look for the answer, as this one, for instance.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

Lucian
Responsive Resident
Responsive Resident

Hi @v-evelk

 

And thank you for your time. Unfortunately I'm not an R expert too... 🙄 and the recommended code is way to complex to find a "clue" to solve my problem.

 

Maybe Microsoft will publish some tutorials specifically designed for R & Power BI... 😉

 

Kind Regards,

Lucian

v-evelk
Microsoft Employee
Microsoft Employee

Hi Lucian,

 

Technically, there aren't so many Power BI aspects in R code for R visual. Only a couple of them is reading of format panel options and buckets to build dataset.

In fact, to write R visual, you should know only R language.

If you want to figure out how to work with dataset, you should learn R, may be this and that articles will be useful.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

Lucian
Responsive Resident
Responsive Resident

Hello @v-evelk

 

Thank you for the recomended materials... There are good starting points in learning R.

Until then... I hope I will get enough votes on the Improved table visual - dynamic column names ideea so it would be implemented without needing R. 😁

 

Kind Regards,

Lucian

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors
Top Kudoed Authors