How to find the number of days between two dates in Power BI?

Calculate number of days between two days in Power BI To find the number of days in between two dates in Power BI use the DAX DATEDIFF function: Find date differences in PowerBI – A Practical Example Calculate time differences excluding Weekends To calculate the number of days between two data times, but exclude weekends … Read more

How to add a year column to a Power BI table using DAX?

Create a year column in Power BI You can add a year variable to your BI data model by following this process: Format date / time column as year To format a Power BI date value as a year column use the following process: Extract the year and month values from a date column Here’s … Read more

How to check if a Power BI column contains a text string?

Use the following DAX expression to check whether a table column in your Power BI data model contains a specific string: For example: Search for multiple strings: For example: Check that text exists in a Power BI column Importing your Data Set For this example, we will use a simple list of courses that we … Read more

How to convert number to text string in Power BI?

To cast a Power BI column from integer or decimal format to string texts use the following DAX code: Import dataset to Power BI I will first go ahead and import a sample office list from an Excel file managed by the Real Estate folks. Here is the data set that we have acquired into … Read more

How to add a month number column in Power bi?

Melvin asks: I have a date column in my Power BI model. Can you explain how to create both month name and month number to the Power BI report i need to prepare for the next management meeting? Creating month columns in Power BI Define a date column In case you still don’t have a … Read more

How to convert dates to text values in Power BI?

Here’s a question from our reader, Martina: I have a table that contains date values. For reporting purposes, i would like to transform those dates into a custom text string which includes the date, month and year, which i would like to use when creating tables and charts in my report. Any ideas are appreciated … Read more

How to group Google Sheets pivot table data by week number?

Here’s a question from Dorothy: I am using Google Sheets and trying to use a Pivot table to group my data according to the week number. For some reason, that is not possible, although i see many other useful grouping options such as day of the week, day of the month, year-month etc’/ Any hints … Read more

How to sort Power BI chart x axis by month & date?

Here’s a question from Emilio: I loaded an Excel spreadsheet to my Power BI desktop app, and inserted a stacked chart visual. When looking at the x axis i see that the chart month axes (X) is sorted our in a wrong order – in my case alphabetically – which doesn’t make much sense. How … Read more