Replace BLANK with Zero in Power BI Visuals Such as Card

If you use a field in a visual and based on a combination of slicer selection, that field doesn’t have any value, you might see blank in the visual. If you want to replace that blank to zero, here is a trick for you. a very simple trick that you can use anywhere easily. Sample Read more about Replace BLANK with Zero in Power BI Visuals Such as Card[…]

Find a Text Term in a Field in Power BI Using DAX Functions

In Power BI, there are multiple ways of searching for a text term inside a text field, you can use Power Query for doing this operation or calculations in DAX. In this post, I’ll explain some functions in DAX that you can use to do this calculation. Most of these functions can be used inside Read more about Find a Text Term in a Field in Power BI Using DAX Functions[…]

Calculating Stock on Hand Using DAX: Power BI Inventory Model

You don’t have always the luxury of having a snapshot fact table that has the stock on hand value for every single day, at every single workshop, and for every single product. Even if you want to build such a table, it can get easily gigantic. In this blog post, I am going to show Read more about Calculating Stock on Hand Using DAX: Power BI Inventory Model[…]

Removing the Total Value for a Column in the Table Visual of Power BI Using ISFILTERED

Table visual is one of the most commonly used visuals. In Power BI, you can turn off the total row (when it won’t make sense to have the total) entirely. However, you cannot turn off the total for some columns and keep it working for the others. Using a DAX function, you can, however, do Read more about Removing the Total Value for a Column in the Table Visual of Power BI Using ISFILTERED[…]

Sentiment Colors for Gauge Visual in Power BI

Gauge Visual is a great visual for KPIs, however, the Gauge visual in Power BI doesn’t have the sentiment colors as an option. Sentiment colors make a gauge much more understandable, you can easily find out is the value high, low, or in the mid-range. Fortunately, there is conditional formatting that can help. In this Read more about Sentiment Colors for Gauge Visual in Power BI[…]

Sort a Column with a Custom Order in Power BI

I have previously written about how to sort a column by another column, and I used Month Names as an example. However, still, many are unaware that the same technique with slight modifications can be applied to any other columns. You can have a text column in your slicer (product category for example), and sort Read more about Sort a Column with a Custom Order in Power BI[…]

Caution When Using Variables in DAX and Power BI

I have written another blog post about variables previously and explained how useful variables are. Variables in DAX are helpful in both readability and also the performance of your code. However, there are scenarios that you have to be careful when you use variables. Because variables are stored, they might return a result that is Read more about Caution When Using Variables in DAX and Power BI[…]

Write Conditional Statement Using SWITCH in DAX and Power BI

Conditional expressions are one of the most commonly used expressions in any language as well as DAX. However, in DAX, if you have multiple IF THEN expressions, there is an easier way of doing it; using a function called SWITCH, this blog is about how you can use switch function in DAX and Power BI Read more about Write Conditional Statement Using SWITCH in DAX and Power BI[…]

DAX Variables: Better Readability, Consistency, and Performance in Power BI Calculations

Have you ever had a scenario that you need to use part of your calculation multiple times? You might go and create a table or column for that and then re-use it. However, there are times that you just need that calculation to be re-used multiple times within one place. DAX variables can help you Read more about DAX Variables: Better Readability, Consistency, and Performance in Power BI Calculations[…]

Calculate Totals in Power BI: Using Iterators in DAX

The total value that you see in a table is not actually SUM of all values in that column, it is, in fact, the calculation, when there is no filter. This, however, might not be the calculation that we want sometimes. we might want this value to be the sum of values of that column Read more about Calculate Totals in Power BI: Using Iterators in DAX[…]