Sort Column Name in Power Query via M Code

Sometimes people ask questions about how to order columns in Power query, mostly for Queries with Lots of Columns. We can reorder column Name with Drag and Drop or use Move in GUI to change the column’s order, but it is also possible to reorder via code. In this post, I will show how to Read more about Sort Column Name in Power Query via M Code[…]

Adding Pre-Calculated Rank in Power BI Using Power Query

There are multiple ways that you can add a RANK column to your table, You can do that dynamically inside the Power BI report using DAX Measures, or you can do it pre-calculated. If you are doing a pre-calculated rank (let’s say for an aggregated table or something like that), then it would be perhaps Read more about Adding Pre-Calculated Rank in Power BI Using Power Query[…]

PL-300: Power BI Exam Prep: Connecting to data sources

If you want to pass the PL-300 exam, there are some areas in that your skills will be assessed, and one of those is identifying and connecting to the data source and changing data source settings. Power BI Supports over 140 data sources, each data source has some connection configurations. Below you will learn the Read more about PL-300: Power BI Exam Prep: Connecting to data sources[…]

Power BI Get Data from Google Sheets

Power BI can get data from Google Sheet now. This functionality is released just yesterday and announced in both Power BI and Power Query blogs. The feature is still preview (Beta) but it is worthwhile looking at how it works in a quick article and video. Video Google Sheet’s URL To get data from a Read more about Power BI Get Data from Google Sheets[…]

Power BI Date or Calendar Table Best Method: DAX or Power Query?

So you want to create a date or calendar table in Power BI, and you search for ways to do that. Then you will find many different approaches for that. Some of the approaches are using Power Query, some are using DAX. Which method is the best? What is the actual difference between a date Read more about Power BI Date or Calendar Table Best Method: DAX or Power Query?[…]

Power Query Transformation Pattern: Convert Status Log Dates Table to Start and End Date Table in Power BI

I have previously explained how to analyze the data of a status log table and a from/to date table (like a subscription pattern). I also explained that in some scenarios a from/to table works better than a status log table. In this article and video, I’ll explain how you can transform or convert a status Read more about Power Query Transformation Pattern: Convert Status Log Dates Table to Start and End Date Table in Power BI[…]

Generate Year Month Day Combinations in Power BI Report using Power Query Date.ToText Function

A common requirement when reporting data with a Date axis is to be able to see the year and the month in a short form beside each other. Formats such as 2021 Jan, or Jan 2021, or even Jan 21, or 2021-01 are very popular. In Power BI, ideally, you should have a Date dimension Read more about Generate Year Month Day Combinations in Power BI Report using Power Query Date.ToText Function[…]

Add Leading Zeros to a Number in Power BI Using Power Query

There are a lot of situations where you need to add some leading zeros to a number. A common example of this is to create a month-year combination code using both month and year, and making sure the month is always two digits, regardless of being 1 or 12. There are many different ways of Read more about Add Leading Zeros to a Number in Power BI Using Power Query[…]

Change the Data Source TYPE of the Power BI Dynamically using Power Query Parameters

I have written a blog article and explained how Power Query parameters can be used to change the data source in Power BI. Another useful scenario of it is actually to change even the data source itself. For example, you may have two data sources with exactly the same data structure (columns), but different data. Read more about Change the Data Source TYPE of the Power BI Dynamically using Power Query Parameters[…]

Power Query Function: Column Value Distribution in Power BI

If you have a table and want to create a report of column value distribution of it in Power BI, This function helps you achieve it. I have explained previously in another blog and video, how to do this process step by step. In this article, I’ll share the code for a custom function that Read more about Power Query Function: Column Value Distribution in Power BI[…]