#Microsoft Power BI Archives -

Tag Archives: #Microsoft Power BI

How to Trim and Remove Spaces from Multiple Columns in Power Query

Efficient data cleaning is a crucial step in any data preparation process, and Power Query makes it easy to handle common tasks like trimming and removing unnecessary spaces with functions that you can apply across multiple columns and queries at once. By creating and invoking a function, you can quickly trim and remove spaces from all the columns & tables you need, saving time and effort. In this blog, we’ll show you how to use Power Query functions to streamline your data-cleaning process. The power query we are going to use to trim text in columns is – (text as text, optional char_to_trim as text) =>letchar = if char_to_trim = null then ” ” else char_to_trim,split = Text.Split(text, char),removeblanks = List.Select(split, each _ <> “”),result=Text.Combine(removeblanks, char)inresult This Power Query function takes text as input and removes extra spaces or a specified character from a text string. It splits the text into parts, filters out empty strings, and recombines the cleaned parts using the specified character. If no character is provided, it defaults to removing spaces. The power query we are going to use to remove spaces from the text is – (InputTxt as text) => let Clendata = Text.Combine(List.Select(Text.Split(Text.Trim(InputTxt),” “),each _ <> “”),“”) in Clendata The Power Query function removes all spaces from a given text string. It trims the input, splits it by spaces, filters out blanks, and then combines the parts into a single string. The result is a clean, space-free text, ideal for standardized data preparation. Now, we have our power query function ready, we can use this function across multiple columns or dataset. To do so, go to Add Column > Invoke Custom Function > Your Power Query Function. To conclude, Cleaning and transforming data in Power Query become much easier and more efficient with the use of custom functions. Whether you need to remove spaces, clean multiple columns, or standardize text, these functions save time and ensure consistency across your dataset. By applying these techniques, you can handle large, messy datasets with ease, making your data ready for analysis or reporting. Start implementing these simple yet powerful methods today to streamline your data preparation process! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Add Tooltip for Column Headers in Power BI: A Step-by-Step Guide

Introduction Tooltips are a powerful feature in Power BI, offering additional context and information for visuals. However, tooltips are not natively supported for column headers in Power BI. This means users cannot view detailed information about column headers directly. Fortunately, there’s a workaround to address this limitation, which we’ll explore in this blog post. The method we are going to use is the Action buttons. We will add an action button to column headers, and the action button will have a tooltip that shows header details. Please find a step-by-step guide for the same – 1.       First, we need to insert a button. Here I have used a blank button since I want to show the tooltip when the user hovers through a particular column area, but you can use any of the buttons based on your choice. 2. Now, go to the button visual settings, turn on the action button, set the type to bookmark with None as an option, and specify the tooltip. Conclusion In this blog post, we discussed adding tooltips to the column headers to give users more context. we hope you found this blog post helpful! If you have any questions or want to discuss further, please contact us at transform@cloudfronts.com.

Microsoft Power BI – Joining contents of two tables into one table using Append Power Query

In this blog we will learn how to append two or more table into new table or existing table. The Append Queries in Microsoft Power BI is an equivalent of UNION ALL in SQL. Consider two sample customer table; one for CustomerOne: And Customertwo: Open Microsoft Power BI for Desktop > Get Data > Excel > the excel file. You should see this: Select tables and click on Transform Data. Now it’s time to proceed with the Append operation itself: Click the little triangle on the main “Append Queries” button. You’ll get 2 options: Append Queries – this operation would add rows into an existing table Append Queries as New – this operation will create a new output table from 2 (or more) appended tables. I’m going for this option. So, let’s see what happens after clicking the “Append Queries as New” button: You either append 2 tables like me OR you can do “Three or more”. So, keep in mind you are NOT limited to 2 tables only. One important thing to understand how the tables are actually “appended” together. Power BI looks at column names. If it finds the same columns like in my case (CustomerID, First Name, Last Name, Contact No) in both the tables, it won’t create any new columns and it will fit everything right into those 4 columns. What about Duplicates? Append Queries will NOT remove duplicates. You have to use Group by or Remove Duplicate Rows to get rid of duplicates. So, you press OK and you get the result of your operation. Now the result: Hope this helps!

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange