User Profile
ChristianAU
Frequent Visitor
Joined 2 years ago
User Widgets
Contributions
R correlation plot visual
In the uploaded image under the code, I would like the black text marked within the red line to be white. I'm not sure how to write the code to address this issue. The code I've used to make the R script visual is: # Paste or type your script code here: # Load necessary libraries library(ggplot2) library(reshape2) library(corrplot) # Ensure that the dataset is not empty if(nrow(dataset) > 0) { # Compute the correlation matrix cor_matrix <- cor(dataset, use = "complete.obs") # Increase plot size and adjust margins for better readability par(mar = c(4, 4, 2, 2), oma = c(2, 2, 2, 2), mfrow = c(1, 1)) options(repr.plot.width=10, repr.plot.height=8) # Define custom color palette custom_col <- colorRampPalette(c("#8B0000", "#FFD700", "#006400"))(200) # Set plot background color and text color par(bg = "#003165", col.lab = "white", col.axis = "white", col.main = "white", col.sub = "white") # Plot the correlation matrix using corrplot with custom settings corrplot(cor_matrix, method = "color", type = "upper", tl.col = "white", tl.srt = 45, addCoef.col = "white", number.cex = 0.7, col = custom_col) } else { plot.new() par(bg = "#003165") text(0.5, 0.5, "No data available", cex = 1.5, col = "white") }994Views0likes1CommentRe: New costum column
Thank you for your response. However, i made it work with this solution: = let Source = #"Changed Type4", AddedCustom = Table.AddColumn(Source, "EngagementHours Grouped", each if [Attribute] = "EngagementHours" then if [Value] >= 0 and [Value] <= 5 then "1: 0-5" else if [Value] >= 6 and [Value] <= 10 then "2: 6-10" else if [Value] >= 11 and [Value] <= 15 then "3: 11-15" else if [Value] >= 16 and [Value] <= 20 then "4: 16-20" else if [Value] >= 21 and [Value] <= 25 then "5: 21-25" else if [Value] >= 26 and [Value] <= 30 then "6: 26-30" else if [Value] >= 31 then "7: >30" else null else null) in AddedCustom I tested your solution, and it gave me all errors. I guess you have to make the previous step in power query the source, and not the table itself. Which is weird.485Views0likes0CommentsNew costum column
I wish to make a new column with the name “EngagementHours Grouped”, which is dependent on 2 other columns “Attribute” and “Value” from the table “Course data” (same place I want to make the new column). The code to make the costum column should be something like this, but I can’t seem to make it work: Table.AddColumn(#"Changed Type4", "EngagementHours Grouped", each let Source = #"Course data", AddedCustom = Table.AddColumn(Source, "EngagementHours Grouped", each if [Attribute] = "EngagementHours" then if [Value] >= 0 and [Value] <= 5 then "1: 0-5" else if [Value] >= 6 and [Value] <= 10 then "2: 6-10" else if [Value] >= 11 and [Value] <= 15 then "3: 11-15" else if [Value] >= 16 and [Value] <= 20 then "4: 16-20" else if [Value] >= 21 and [Value] <= 25 then "5: 21-25" else if [Value] >= 26 and [Value] <= 30 then "6: 26-30" else if [Value] >= 31 and [Value] <= 37 then "7: >30" else null else null) in AddedCustom)528Views0likes2Comments- 557Views0likes0Comments
Custom variable 'Status' and custom variable 'p'
I wanna make a new variable called 'status' and one called 'p'. The purpose for this, is to be able to make a response rate. The formula should be something like this: 1. Custom column 'status' if [taskstatus]='submitted' => status = 'answered' else status='not answered' 2. Custom column 'p' [Status]='besvaret' => p=1 else p=0Solved520Views0likes2CommentsCustom Column formula
I wanna make a new custom column in Power Query with a variable called x. The formula should be something like this: if [Semester] value is equal to 'S22' then x = y else if [Semester] not equal to 'S22' and [Scheme] in (#"Course data") then x = y else x = y I’ve no idea how to write the formula so that it works as I wish. Any help is appreciated!395Views0likes1CommentPower BI and Power Query automation
Is it possible to automate the process of 'close and load' in Power Query/Power BI, and subsequently save the file? Background information: My Power BI file is structured around a folder and its files/data. Whenever a new file is added to the folder, Power BI merges and transforms the new data with the existing dataset. However, I am unable to see the new data in the table view; it is only visible in Power Query. As a result, I must manually execute the 'close and load' process whenever new data is added to the folder in order to view it in the table interface. I hope this clarifies the situation.Solved512Views0likes2Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.