Calculating the trend of a Chart using DAX ( Smoothing Moving Average)

Calculating the trend of a line chart can be possible using the Analytics tab under the format section of the chart. What if we need to store this calculation and reuse it or show it as a separate chart? Actual Chart as below The trend of the chart The first question is about calculating the Read more about Calculating the trend of a Chart using DAX ( Smoothing Moving Average)[…]

Power BI DAX: ALL vs. ALLSelected

These two functions in DAX are often used instead of each other; ALL and ALLSELECTED. Their behavior can be similar in some contexts, but it can also be different in other contexts. In this article and video, I’ll explain the difference between these two functions and when to use each in DAX for Power BI, Read more about Power BI DAX: ALL vs. ALLSelected[…]

Power BI DAX: Previous Month-to-Date, Quarter-to-Date, and Year-to-Date Calculations

If you want to compare the sales up to a particular day and compare it with the previous period (month, quarter, or year) but up to that particular day in that period, then it is called previous month-to-date, previous quarter-to-date, and previous year-to-date. These calculations can be more helpful than comparing with the entire period Read more about Power BI DAX: Previous Month-to-Date, Quarter-to-Date, and Year-to-Date Calculations[…]

Set Power BI Data Color: All Visuals to Follow Same Color for the Same Data Point

You can set the color in every visual in Power BI easily. You can also set the color of multiple visuals at the same time using Themes. However, what if you want to set the same color for the same data point? For example, You want the Gender Female to be always colored Orange in Read more about Set Power BI Data Color: All Visuals to Follow Same Color for the Same Data Point[…]

Power BI From and To Date Filtering with One Slicer

It happens that you might have two fields as From and To date (or Start and End date) in your dataset, and you want a date slicer in the report. The date slicer has to filter records in a way that the FROM and the TO dates are in the range of dates selected in Read more about Power BI From and To Date Filtering with One Slicer[…]

Power BI Icon Names for Conditional Formatting Using DAX

I have previously written about conditional formatting in Power BI, and how you can take one step further with using DAX to dynamically change the conditional formatting. Conditional formatting with DAX for colors is easy, you can use the color name or their hex code. But for Icons, it is slightly different. You can either Read more about Power BI Icon Names for Conditional Formatting Using DAX[…]

ConcatenateX in Power BI and DAX: Concatenate Values of a Column

It happens often in Power BI calculations and reports that you need to concatenate a list of values from a column. You can do this concatenation in Power Query or DAX. However, if the concatenation needs to be done dynamically. ConcatenateX is a very helpful DAX function to achieve such results. It is very helpful Read more about ConcatenateX in Power BI and DAX: Concatenate Values of a Column[…]

Power BI Pattern: Find Start and End Date of Task from Children

The project and task planning management systems have the concept of each task starting and ending with a date. Tasks can be a child of other tasks, and the parent tasks should take the whole range that the child task’s date includes. You need to parse the parent-child hierarchy of tasks (which can be many Read more about Power BI Pattern: Find Start and End Date of Task from Children[…]

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?[…]

Generate Year and Month Combinations in Power BI Report using DAX

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 and Month Combinations in Power BI Report using DAX[…]