Комментарии:
Another example of why he's one of the GOATs 🐐! 🎉
ОтветитьHow come the =SUMX(FILTER(CUSTOMER,CUSTOMER[Country]="USA"),SUMX(FILTER(SALES,SALES[CustomerKey]=[CustomerKey]),SALES[Quantity]*SALES[Unit Price])) GRAND TOTAL is not showing the right figure?
ОтветитьThank you, love your explanation! :)
ОтветитьThank you Alberto... Thank God it's weekend, I'll consume a lot of your videos today. Lol
ОтветитьThank you Alberto, very useful.
ОтветитьGreat.... Now clear about all aggregate function with 'X' and without 'X'
And also understand what is ROW CONTEXT exactly
Thanks a lot!!!
Thank you so much Alberto. You have really explained it well after many years of using Power BI , I now understand it so much better
ОтветитьGrazie Alberto for the video.
One question, in the measure "Test", shouldn't
RELATEDTABLE (Sales) be used in the second FILTER function?
Hello community, i think a key idea ,that needs to be noticed, is that a measure can be in one of two shapes , either a single value, or a column of values. And that's why we need to sepecify this thing called context row. A calculated column is always in a shape of a serie of values, thus no need to specify a row context.
What do you think guys?!!🙄
Dear sir, good expiation would request please create more video's on power bi !
ОтветитьHi. Someone could explain my something?
I wrote the follwing measure to calculate month average.
Geração Mes =
VAR dataAtual = SELECTEDVALUE(dCalendario[Date])
VAR mesAnoAtual = SELECTEDVALUE(dCalendario[Mes Ano])
RETURN
IF(
DAY(dataAtual) = 1,
CALCULATE(
DIVIDE([Geração Diaria], COUNTROWS(dCalendario)),
FILTER(ALL(dCalendario), dCalendario[Mes Ano] = mesAnoAtual)
)
)
I tried to apply a combination between AVERAGEX and SUMX, but I didnot work.
In other hand, I tried to use EARLIER instead of SELECTVALUE. However, this did not work.
I dont have performance isues with this measure, but I really want to understand where I lost myself in the conceptions.
Thanks.
You are awesome.
ОтветитьFirst of all, many thanks for such great video. I have question, why when you wrote measure as column SUMX(Sales, Sales[Quantity] * Sales[Unite Price]) we get grand total whereas when you write it as measure it works differently(meaning filter context works and it calculates row by row). If anyone can explain it to me I will highly appreciate :)
ОтветитьThis was a FANTASTIC video on Row Context! I know have a much better understanding of this concept and the roles that an iterator plays. Thank you so much!!!!!!
ОтветитьVery good, easy to understand now.
ОтветитьWonderful video alberto, so we can say that a row context its in a nutshell, a for loop right?
ОтветитьWonderful! That's exactly what I needed to get started with DAX. Thank you very much Alberto for sharing your DAX wisdom.
ОтветитьNotes for future revision.
Row context exist in:
1. Calculated column. By definition - a column consists of rows, and values are calculated row by row.
Amt = sales[qty] * sales[price]
_Works for creating new column, where Amt is calculated row by row, by default.
2. Measure that include table iteration, FunctionX()
Amt = SUM(sales[qty]) * SUM(sales[price])
_Work correctly only in certain situations e.g. the filter (of the the table or visual) is at the lowest granularity e.g. per row, per day per sale per customer.
_Works also at aggregated level e.g. per month, but it gives wrong result. As it gives Total A of all rows x Total B of all row, instead of Total of "AxB of each row".
So, to calculate Amt correctly,
need to first do sales[qty] * sales[price] row by row,
then sum the results from all rows.
How?
How to first multiply row by row, then sum?
Use an X function that iterates row by row. In this case SUMX.
How to first multiply row by row, then sum?
SUMX (row by row multiplication)
But which row of what table? Specify the table!
SUMX (table_name, row by row multiplication)
Similarly, to get an average of a ratio:
AVERAGEX (table_name, row by row division).
For FUNCTIONX( table_name, expression_formula), just imagine a new column of is created in table_name, with value from expression_formula for every row. Then, FUNCTION is applied to all rows
We are blessed to have "SQLBI". Thank you!
ОтветитьThis video is simply great - very well presented and explained
ОтветитьWhat a wonderful teacher. Beautifully done. Thank you!
ОтветитьHow are Dax expression executed? Does the calculation starts from the center out, or the out to in?
ОтветитьSir, you are the best, period !
ОтветитьGreat as always
Ответитьplease share the series wise index
ОтветитьThank you for sharing, really great idea to build the understanding layer by layer:
*Row Context
*Filter Context
*CALCULATE Function
*Context Transition
Ciao Alberto, i am new to Power bi and i really appreciate this video(the First i m going through). It Is extremely useful, thanks so much
ОтветитьThank you for this lesson. I have a question - What is the main goal of this DAX?
First it picks the the country USA from Customer, then filters Sales condition and then the final If condition on the Sales condition right?
So what will this Dax produce?
Edit:
Also may I inquire why you used Sumx when you could have used Sum if you wanted to get only the totals. Example: Sum(Filter(
Any reason I am missing for using Sumx.
thank you very much for the video!!! :D
Ответитьhow to create a row context in a measure if the data is text?
ОтветитьThank you so much for this video. You explained it really nicely.
ОтветитьThank you so much for the time that you give to explain us. That is amazing
ОтветитьThat means every iterator function works as a row context when creating a measure. I mean SUMX, AverageX....etc.
ОтветитьVery nice explanation. Probably best i have ever watched. Finally! Thank You
The code comment in green explains a lot. Such a niuance
Thank you! Great axplanation!
ОтветитьVery good video! Thank you! :)
Ответитьvery good job, ottimo lavoro grazie!
ОтветитьI know this is more advanced than the video is aiming for, but:
in the final code with stacked row contexts, does the concept of Expanded Tables factor in at all?
Very nice!
ОтветитьGreat video! Hope there is a Playlist that aggregates this video with other concept videos.
ОтветитьA última medida foi SHOW!!! Mas uma dica sobre contexto. Parabéns!!!!!
Ответитьthanks very useful as Always
ОтветитьAlberto is the nested SUMX in the end another way of computing something complex from our Fact Table (many side) in our filtering table (1 side) but without calculated column - with column we usually use COUNTROWS.... RELATEDTABLE() but looks to me that Sales[CustomerKey] = Customer[CustomerKey] in the nested sumx could achieve tha same if written correctly
ОтветитьVery nice tips! Thanks for demonstrating. Thumbs up!!
ОтветитьActually, your explanation requires some effort to understand well about the row context and filter context. But once I got it, it blows my mind. Thanks Alberto. Great video.
ОтветитьNice video, Alberto. It actually is a nice addition to the explanation you gave me about context transition earlier today. It definitely is more clear for me now!
Ответитьthank you
Ответить