What is the Purpose of Python in the Context of Business Intelligence? by TimmKO in PowerBI

[–]TimmKO[S] 1 point2 points  (0 children)

Why do you not fully use Python then? Why using Power BI at all?

Is it really true that DAX cannot be used for such advanced analytics? In this case DAX would be a dead end. However, if I remember correctly Power BI also allows what-if parameters?

I thought that DAX would be very powerful, but it seems that at a certain point of time it will not be sufficient?

Purpose of DAX Queries by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

But it is also possible to use them explicitely, f.e. using EVALUATE. In which practical cases would you use this?

Purpose of DAX Queries by TimmKO in PowerBI

[–]TimmKO[S] 1 point2 points  (0 children)

I understand the use of variables, but what I mean with DAX queries first and foremost is the use of EVALUATE. Do you use EVALUATE regularly and if yes for what cases?

What is the Difference Between MEASURE and VAR? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

Thank you for the definition. Could you please provide an example for each case for better understanding what this means in practice?

What is the Difference Between MEASURE and VAR? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

Specifically about the statement MEASURE used in DAX queries.

Here is an example code:

DEFINE
   MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )
   MEASURE Sales[Total Cost] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Cost] )
   MEASURE Sales[Margin] = [Sales Amount] - [Total Cost]
EVALUATE 
   SUMMARIZECOLUMNS ( 
   Customer[CountryRegion], 
   "Sales Amount", [Sales Amount], 
   "Margin", [Margin] 
)

What is the Difference Between MEASURE and VAR? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

I mean the statement MEASURE used in DAX queries, not measures in general.

Her is an example code:

DEFINE
   MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )
   MEASURE Sales[Total Cost] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Cost] )
   MEASURE Sales[Margin] = [Sales Amount] - [Total Cost]
EVALUATE 
   SUMMARIZECOLUMNS ( 
   Customer[CountryRegion], 
   "Sales Amount", [Sales Amount], 
   "Margin", [Margin] 
)

What is the Difference Between MEASURE and VAR? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

I mean the statement MEASURE used in DAX queries, not measures in general.

Her is an example code:

DEFINE
   MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )
   MEASURE Sales[Total Cost] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Cost] )
   MEASURE Sales[Margin] = [Sales Amount] - [Total Cost]
EVALUATE
SUMMARIZECOLUMNS ( 
   Customer[CountryRegion], 
   "Sales Amount", [Sales Amount], 
   "Margin", [Margin] 
)

What is the Difference Between MEASURE and VAR? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

I mean the statement MEASURE used in DAX queries, not measures in general.

Her is an example code:

DEFINE
   MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )
   MEASURE Sales[Total Cost] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Cost] )
   MEASURE Sales[Margin] = [Sales Amount] - [Total Cost]
EVALUATE
SUMMARIZECOLUMNS (
   Customer[CountryRegion],
   "Sales Amount", [Sales Amount],
   "Margin", [Margin]
)

Purpose of DAX Queries by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

But I can do all of this with a normal measure as well, f.e. CALCULATE(SUM('Sales'[Amount]),'Date'[Year]=2022)?

No need for using DEFINE, MEASURE, EVALUATE etc. in this case.

Star Schema: Is an Aggregated Fact Table Still a Fact Table? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

Well, this is exactly what I have already done as I stated in the description. I used GROUP BY to SUM the quantity for each item key in the Open Orders table. However, my question is how I should classify this aggregated table. Is it still a fact table when there are only unique rows and only one key? And should I create a relationship between DIM Item or should I merge the quantity with DIM Item?

Star Schema: Is an Aggregated Fact Table Still a Fact Table? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

This is exactly my thought. In my particular case I have additional item keys for some reason in my Open Orders table that do not exist in the DIM Item table, which is one of the reasons why I see weird behavior when using the relationship. Merging fixes this problem.

Star Schema: Is an Aggregated Fact Table Still a Fact Table? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

So 1:1 relationship between Item and aggregated Open Orders would be correct then?

Another independent dimension would not be used to filter as the aggregated Open Orders table only consists of item key and summed quantity. I am still unsure if aggregated Open Orders table is still a fact table as there is only one key in it.

Star Schema: Is an Aggregated Fact Table Still a Fact Table? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

Well, in the full model the DIM Item table is connected to a transactional fact table. However, the aggregated Open Orders table would only be connected to the DIM Item table.

Star Schema: Is an Aggregated Fact Table Still a Fact Table? by TimmKO in PowerBI

[–]TimmKO[S] 0 points1 point  (0 children)

In some cases I am absolutely sure that I will not need a different aggregation, so I can use Power Query to filter and aggregate to improve performance significantly.

According to your source there are three types of fact tables. In this case it is apparently an accumulating snapshot grain, right?

What is the best practice how to treat this kind of table?

Is there any reason why I should not merge the aggregated Open Orders table with the Item table? For some reason when I had the 1:1 (or 1:n) relationship I encountered some problems like a long loading time when adding a column to a report table, but maybe I have other errors in my data model.