Тёмный

CALCULATE in DAX #10: Using TREATAS 

SQLBI
Подписаться 103 тыс.
Просмотров 48 тыс.
50% 1

Learn how to use TREATAS in CALCULATE filter arguments.
How to learn DAX: www.sqlbi.com/guides/dax/?aff=yt
The definitive guide to DAX: www.sqlbi.com/books/the-defin...
CALCULATE function: dax.guide/calculate/?aff=yt

Наука

Опубликовано:

 

11 ноя 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@rcb3921
@rcb3921 3 года назад
This whole series is well worth periodic re-watching.
@jorparts
@jorparts 3 года назад
Hands down ... When I watch these videos it is like programming poetry. What level!!!! Thanks
@amadiftikhar3227
@amadiftikhar3227 3 года назад
TREATAS function always looked strange to me and was never able to understand it until this Video. Thank you Alberto and SQLBI :)
@rcb3921
@rcb3921 3 года назад
I agree. Something about it is intimidating. This video really demystifies what's going on.
@NL-tq1yr
@NL-tq1yr 2 года назад
@@rcb3921 yeah, it's intimidating because iirc every measure which is based on a relationship in dax is basically translated into a query that has treatas in it, dax doesn't understand relationships it's just translates every measure you write into a treatas statement.
@kurtdevotto
@kurtdevotto 3 года назад
You guys always blows my mind!
@VertexRecords
@VertexRecords 3 года назад
These videos are incredibly useful! Thanks for sharing your knowledge :)
@danielsiffredi8403
@danielsiffredi8403 3 года назад
Never used treatas before, but I can see now how useful this is thanks to your great explanation. Thanks again!
@inkuban
@inkuban 3 года назад
The best explanation in my opinion for users with intermediate knowledge.
@yeraldo05
@yeraldo05 3 года назад
Amazing!!!! Mind-blowing as always!!!
@engvictorfarias
@engvictorfarias 3 года назад
Thanks, Alberto! Hugs from Brazil.
@wmfexcel
@wmfexcel 3 года назад
Amazing! Thanks for this great video that explains the TREATAS so well.
@Bharath_PBI
@Bharath_PBI 3 года назад
Yes, it's very common in queries returned by performance analyser, quick measures.. etc., But still not so common among DAX users, not many people use it at least from what I see. The SQLBI blog about treatas is a wonderful article that describes it's efficiency. Appreciate it. Thank you.👍
@germanhenriquez24
@germanhenriquez24 3 года назад
Wow! Thanks Alberto ! With this I will be able to solve a scenario.
@joaquimcosta952
@joaquimcosta952 3 года назад
Amazing explanation like always!
@scramiro1
@scramiro1 3 года назад
Thanks so much! Much clearer I was stuck with this function in your book, so this helped a lot. Enjoy DAX ;-)
@beginho2454
@beginho2454 3 года назад
Great! i use your tips to sovle the self-defined date calendar calcuation. Really Amazing!
@mwaltercpa
@mwaltercpa 3 года назад
Thank you Alberto, it’s great to know TREATAS can be used for this, and supports multiple columns. Especially helpful when we don’t have a relationship between the tables established. Thanks!
@zxccxz164
@zxccxz164 4 месяца назад
but why don't you just create the needed relationship???
@3danim8r1
@3danim8r1 2 года назад
Really Helpful...Thank you!
@marlonmunozguevara7778
@marlonmunozguevara7778 3 года назад
Waoo Amazing Explanation. Thanks Alberto , I really enjoy Dax!
@alexandrab1534
@alexandrab1534 5 месяцев назад
Amazing ! Really Helpful...Thanks Alberto
@gourisankart6348
@gourisankart6348 3 года назад
Wooow really I'm feeling great to subscribe the channel and learning DAX in easy understand manner. Thanks for your effort to share your knowledge 📚 to everyone.
@__HumanBeing
@__HumanBeing 2 года назад
Beautiful function!
@johng5295
@johng5295 2 года назад
Thanks in a million. Great content. Awesome. Grade: A++💥
@chutkiandsaharsh3435
@chutkiandsaharsh3435 3 года назад
you are sharing awesome knowledge
@user-sb5vf7qq1e
@user-sb5vf7qq1e 3 года назад
Have seen Treatas in DAX Studio, was not clear about the semantics behind. Thanks SQLBI ! DAX Master.
@umasankarthellapuri5560
@umasankarthellapuri5560 3 года назад
Wooowww it's Amazing... Thank you soomuch...
@heniekheniek1781
@heniekheniek1781 3 года назад
This is great, thanks a lot!
@Kmsbi
@Kmsbi 3 года назад
wonderful information like always
@2404Pepe
@2404Pepe 3 года назад
So grateful !!!! thanks!!!!! molte grazie!!!! grazie infinitamente!!!! GRACIAS !!!!! great work
@distrilanalytics
@distrilanalytics 3 года назад
Wonderful video.
@cellfonership
@cellfonership 3 года назад
Thank you. I think the first example is good to demonstrate the general purpose of the function, but it is the second one that highlights the most appropriate use case - it is "IN" functionality but for multiple columns at the same time. Very valuable lesson!
@SQLBI
@SQLBI 3 года назад
In reality IN is a simple example, but the IN syntax is good especially for one or just a few values. TREATAS is handy in more complex situations or when you manage larger lists of values to filter.
@tangtom2478
@tangtom2478 3 года назад
Crazy, how you make the TREATAS so easy to understand?
@abeworldforever
@abeworldforever 3 года назад
Very Interesting! Is it more performant than using the "in" statement you used earlier?
@SQLBI
@SQLBI 3 года назад
Not much for few elements, it could be better if the number of elements is large. As usual, you should check on your model and your specific case!
@RonaldPostelmans
@RonaldPostelmans 3 года назад
Can the database you use for your video’s be downloaded somewhere? Its a Nice dataset for practise. Nice video
@SQLBI
@SQLBI 3 года назад
It is part of the companion content of our book - the book is on sale, the companion content can be downloaded here: www.sqlbi.com/books/the-definitive-guide-to-dax-2nd-edition/
@ildikokovacs2254
@ildikokovacs2254 Год назад
I want to filter one table (FactOpenItems[OpenValue_Open] with one column OR relationship between the other two tables (live DimSalesProcess[ProcessID], live DimPaymentInfo[PaymentType]. Can it be used for this as well? The two filter tables are related to the fact table.
@galatemalate1256
@galatemalate1256 3 года назад
When the formula had only year I was like meh... then it was used year+month and I was like WHAAAAAAATT
@razor9373
@razor9373 3 года назад
Is there a way to use TREATAS with the selected value in the slicer to filter a table?
@SQLBI
@SQLBI 3 года назад
The selection in a slicer can be read using VALUES, but I'm not sure about what you want to achieve with TREATAS.
@samirkumar6180
@samirkumar6180 3 года назад
Hi alberto, is there any way i can make my report calculate ytd, mtd and ,qtd and wtd values from financial year considering 01-apr as the starting month of the year and 31-mar of next year as end month of the year...??
@SQLBI
@SQLBI 3 года назад
There is an additional parameter in standard time intelligence functions, but you cannot use them for week calculations. See www.daxpatterns.com/time-patterns/ for all the possible combinations.
@samirkumar6180
@samirkumar6180 3 года назад
@@SQLBI many thanks for the reply, will check the link surely
@rauljimenez5485
@rauljimenez5485 3 года назад
Great information!!! In terms of performance, how does TREATAS compare to using "FILTER" or "CALCULATETABLE"?
@1yyymmmddd
@1yyymmmddd 3 года назад
I guess that Power BI internally translates all the relationships into respective TREATAS functions when building queries, isn't it?
@SQLBI
@SQLBI 3 года назад
No, technically it works in a different way, but details about the query plan could change over time so don't rely too much on them.
@gulhermepereira249
@gulhermepereira249 3 года назад
In terms of performance, how faster (%) can TREATAS be when compared to "IN" approach?
@SQLBI
@SQLBI 3 года назад
It depends, it could be relevant for large sets. Test the performance on your model and your specific case!
@zxccxz164
@zxccxz164 4 месяца назад
i don't get it. Why would you use treat as when then relationship works fine? And if you don't have a relationship, why not create one. I am sure this is very powerful, but this example isn't helping me understand
@llau0203
@llau0203 3 года назад
Hi Alberto, Thank you for your sharing. I have difficulty to understand the following situation. I wonder if you have help me out. At 0:11, we can see the Sales 2007-2008 is always 21,237,259.11 for each row and this is expected. Note: This is because the context Year Number from the CALCULATE overwrites the Year Number from the Row Context if I understand correctly. I understand I can user KEEPFILTERS if I don't want 21M (total sales for 2007 and 2008) for each row and I want Sales for each individual year. Year Number Sales Amount Sales 2007-2008 -------------------- ----------------------- --------------------------- 2007 11,309,946.12 21,237,529.11 2008 9,927,582.99 21,237,529.11 2009 9,353,814.87 21,237,529.11 -------------------- ---------------------- ----------------------- Total 30,591,343.98 21,237,529.11 where Sales 2007-2008 = CALCULATE( [Sales Amount], 'Date'[Year Number] IN { 2007, 2008 } ) However, if I create the similar table using "Calendar Year" instead of "Year Number" then I expect the same behaviors but the Sales CY 2007-2008 is not 21,237,259.11 for each row. Do you know why? Calendar Year Sales Amount Sales CY 2007-2008 ---------------------- ---------------------- -------------------------- CY 2007 11,309,946.12 11,309,946.12 (expect 21,237,529.11) CY 2008 9,927,582.99 9,927,582.99 (expect 21,237,529.11) CY 2009 9,353,814.87 (expect 21,237,529.11) ---------------------- ----------------------- ------------------------- Total 30,591,343.98 21,237,529.11 Where Sales CY 2007-2008 = CALCULATE( [Sales Amount], 'Date'[Calendar Year] IN { "CY 2007", "CY 2008" } ) Note: The only difference between the two tables is "Year Number" which is defined as numbers and "Calendar Year which is defined as characters. Please note that similar behavior occurs for Fiscal Year. Thanks, Lawrence
Далее
Propagating filters using TREATAS in DAX
19:18
Просмотров 43 тыс.
Row Context in DAX
20:42
Просмотров 93 тыс.
КАКОЙ У ТЕБЯ ЛЮБИМЫЙ МАРМЕЛАД?
00:40
Как выходим с тройняшками 🙃
00:17
Understanding context transition
18:25
Просмотров 64 тыс.
CALCULATE in DAX #09: VALUES vs. KEEPFILTERS
4:35
Просмотров 61 тыс.
How To Use The TREATAS Function - Power BI & DAX
10:14
Differences between GROUPBY and SUMMARIZE
28:30
Просмотров 33 тыс.
What is DAX?
17:48
Просмотров 39 тыс.
DAX Fridays! #66: TREATAS
10:39
Просмотров 22 тыс.
Using KEEPFILTERS in DAX
14:22
Просмотров 25 тыс.
iPhone перегрелся, что делать?!
1:01