Machine Learning

Why don't you have to replace spaces with 0 in Power Bi

Viewing Jeffrey Wang as a live stream with Red Havens, and one of the ten good things Jeffrey shared with the audience that creates the correct question program.

Also, who holds my attention was about what is called “good ways”:

Screenshot from live streaming on YouTube

To make it easy, as soon as you explain the ratio, the formula engine in Vertipaq will add a complete nonnomompeter to the question, should be able to make full-time joint control. For people from MDX world, an unwavering work can look familiar, but let's see how it works in Dax.

Something that had been met too much when Jeffrey is advised for returning the posts in Mores (or vivid numbers) in the calculation. I am already telling how to handle spins and place in the zeroes, but in this article, I want to focus on the operation of this decision.

Setting a Category

Before we start, a significant important statement: Recommendation to return to the blank point at 0 that – recommendation. If a business request displays 0 instead of blank, it does not mean that you must refuse to do it. In many cases, you will probably not be aware of the decline in performance, but it will depend on different things …

Let's start writing our simple DAX's rate:

Sales Amt 364 Products =
CALCULATE (
    [Sales Amt],
    FILTER ( ALL ( 'Product'[ProductKey] ), 'Product'[ProductKey] = 364 )
)

Using this quote, I want to calculate the total sales of product by proundkey = 364. And, if I place the amount of this point, I have turned to a review of this question, I get the following results:

Photo by the writer

DAX's question has only been done 11ms to do, and if I switch to Dax Studio, XMSQL generated by the simple search engine:

Photo by the writer

Also, when I view the question program (physical), I see that the installation engine gets only one combination of prices for returning our data:

Photo by the writer

Adding more ingredients …

However, suppose you request a business application to analyze product key 364 at everyday level. Let us go and add the days of our report:

Photo by the writer

This was too fast! Now I will check the metrics within the Dax studio:

Photo by the writer

In the meantime, the question was expanded to include a table of days, which affected the project engine needed to do, as instead of only one line, in this case, the number is different:

Photo by the writer

Of course, you will not be aware of any difference in operation between the two conditions, as the difference is only a few mileseconds.

But this is just the beginning; We simply warm up our DAX engine. In both cases, as it may be seen “only the” amounts “” – this combination of contentment in this product – if you look well and those days.

This is because the formula is a wise engine enough to complete the days when 364 product you have no sales of filter, which is why the 564 product sales were empty:

Photo by the writer

Now, Suppose business users also want to see those inner days, where the 364 product did not sell. Therefore, the vision show 0 $ for all those days. As described in the previous article, there are a variety of different ways to install the posts in Mees, and I will use COALESCE() Work:

Sales Amt 364 Products with 0 = COALESCE([Sales Amt 364 Products],0)

Basically, the COALESCE The work will look at all the given conflicts (in my case, there is only one dispute) and replace the first amount of the amount you specified. Simply said, it will test whether the number of amt Amt products are empty. If not, it will display a number listed; Besides, it will take an empty place with 0.

Photo by the writer

Wait, what?! Why do I see all the products, when I set everything, without product 364? Let's stop, my table now take 2 seconds to give! Let's see what happened in the background.

Photo by the writer

Instead of producing one question, we now have three of them. The first one is the same as the last crash (58 lines). However, the remaining questions are aimed at the tables and tables, pulls all lines from both tables (product table containing 2517 lines, while the Dutch table with 1826). Not just that, see the question program:

Photo by the writer

4.6 million records?! Why the World Happed?! Let me do math: 2.517 * 1.826 = 4.596.042… So, here we joined the product and tables, to force all the same sores (day products) to get tested! That happened because we forced the engine to return 0 of all alone wounds to come blank (and as a result were released to scan)!

This is a simple view of what happened:

Photo by the writer

Believe it or not, there is a good solution to show blank prices to get out of the box (but, not 0 instead of blank). You can just click on the Date field and select Show items without data:

Photo by the writer

This will show empty cells and, but without making full joining between product and tables of tables:

Photo by the writer

Now we can see all cells (even posts) and this question has taken half a prior period! Let's look at the question program produced by formula engine:

Photo by the writer

Not all situations are a disaster!

The truthfulness to be said, we could reorganize our average unwanted records, but it will not be the best way to eliminate empty records.

In addition, there are certain situations when it takes place in the empty gaps with zero will not cause a decrease in important operation.

Let's examine the following situation: We show data about the total sales amount in every single product type. And I will enter my rating for selling a product ratio 364:

Photo by the writer

As you can expect, that was very fast. But, what will happen when I add my score to spaces 0, causing abuse in previous situation:

Photo by the writer

HM, it seems that we should not pay any compensation according to work. Let's see the question's program for the DAX question:

Photo by the writer

Store

As Jeffrey Wang has been lifted, you should stay away from the returning posts. However, if any reason you need to install a blank space for a certain amount of meaning, recognize when and how to do it.

As usual, depending on the lowest features – or when you do not display data from many different tables.

Thanks for reading!

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button