Filter columns, not tables, in DAX

  Рет қаралды 10,726

SQLBI

SQLBI

Күн бұрын

Why you should always filter columns and never filter tables with CALCULATE in DAX!
Article and download: sql.bi/847199?...
How to learn DAX: www.sqlbi.com/...
The definitive guide to DAX: www.sqlbi.com/...

Пікірлер: 54
@stuartsaint4581
@stuartsaint4581 19 күн бұрын
"Whenever you reference a table in DAX, it is always the expanded table." I see this a lot when somebody starts learning DAX coming from an Excel background, it's a hurdle that people don't necessarily have if you come from a SQL background where this concept is more familar. If you are watching this and feel frustrated to have not known this earlier, remember that you were smart enough to get this far in the first place!
@leppyr64
@leppyr64 5 күн бұрын
This 100%
@akshayebenezar
@akshayebenezar 19 күн бұрын
Do you have a video/ playlist with all the golden rules n best practices. Love your work!! ❤
@pluu153
@pluu153 18 күн бұрын
Thank you so much for providing such valuable free content. After using Power BI for six months, I've gained a solid understanding of the concepts you've taught. Your lessons have been instrumental in my professional growth as a power bi data analyst
@jonoakdale
@jonoakdale 19 күн бұрын
I've been waiting for an in depth explanation around this golden rule for a while; thank you!!
@Nalaka-Wanniarachchi
@Nalaka-Wanniarachchi 19 күн бұрын
Another Fantastic one.Alberto & Marco always opens new horizons in DAX to think over.
@nishantkumar9570
@nishantkumar9570 19 күн бұрын
Thanks so much for sharing the understanding about the difference in table and column filters and it's impact. Will definitely keep this in mind while writing measures.
@nevermore17011990
@nevermore17011990 18 күн бұрын
if there is a nobel for DAX, this guy deserve it !
@emersonlopez5310
@emersonlopez5310 19 күн бұрын
Great video, thanks a lot. I got the same result by modifying the "Sales Amount" and "Receipts Amount" measures because in sumx I used filtered tables for multiplications greater than or equal to 500, however I am doing a double iteration in each case.
@gurvindersingharora5301
@gurvindersingharora5301 9 күн бұрын
Please upload more dax videos related summarize and ADDCOLUMNS together usage
@mwaltercpa
@mwaltercpa 18 күн бұрын
Thanks for this insight on expanded tables.
@gvitullib
@gvitullib 19 күн бұрын
Thank you. A great article/video on this important golden rule!
@fsanfo
@fsanfo 19 күн бұрын
Thanks for sharing! I think it would be nice to have a video about when the use of filters in tables is unavoidable.
@SQLBI
@SQLBI 18 күн бұрын
Never?
@workstuff5253
@workstuff5253 19 күн бұрын
Counting with Alberto! Love it!!
@nikakalichava8012
@nikakalichava8012 19 күн бұрын
Thank you for sharing this. really insightful.
@rowanschoultz1022
@rowanschoultz1022 11 күн бұрын
Alberto, you mentioned that this is one of the "golden rules of DAX". Do you have a compilation of these golden rules available anywhere? See you Sep 18th in Calgary.
@ajaaskelainen
@ajaaskelainen 9 күн бұрын
Thank you!
@RobertoStaltari
@RobertoStaltari 19 күн бұрын
SQLBI: Masters at work.
@anilyadav-rt4sr
@anilyadav-rt4sr 19 күн бұрын
Thanks Sir ji after a long time create a nice video
@xyclos
@xyclos 15 күн бұрын
Great explantion, Thanks!
@marcofestu
@marcofestu 18 күн бұрын
The DAX magister
@brnnie
@brnnie 18 күн бұрын
Thank you for sharing this ❤
@lovlyhearts288
@lovlyhearts288 15 күн бұрын
Nice explanation
@AlirezaEmamiFard
@AlirezaEmamiFard 19 күн бұрын
Thanks, it's really useful
@anoopdube9581
@anoopdube9581 19 күн бұрын
Very insightful
@dutch-man
@dutch-man 19 күн бұрын
Nice video as usual 😎👏
@stylianoschiotis5191
@stylianoschiotis5191 19 күн бұрын
Excellent 👌
@paulinafaryna6372
@paulinafaryna6372 19 күн бұрын
This is brilliant
@mogarrett3045
@mogarrett3045 19 күн бұрын
thank you
@common_sense4753
@common_sense4753 19 күн бұрын
@sqlbi thanks. I just got confused, though. I always thought that what you described as the column filter was ultimately converted by the engine to filter(all(sales), amount>=500) Now I’m confused :)
@SQLBI
@SQLBI 18 күн бұрын
It is converted to a column filter, not to a table filter: www.sqlbi.com/articles/filter-arguments-in-calculate/
@Nalaka-Wanniarachchi
@Nalaka-Wanniarachchi 17 күн бұрын
@@SQLBI Ah,That means FILTER(ALL(Sales[Quantity],Sales[Net Price]), Sales[Quantity] * Sales[Net Price] >= 500) etc..?
@gnico64
@gnico64 14 күн бұрын
@@Nalaka-Wanniarachchimy question exactly! Need to try it on a model to make sure it works like this or not
@louiseshorten9389
@louiseshorten9389 19 күн бұрын
I didn’t know about the golden rules. Thanks for this video! Just wondering, I assume you could add a Boolean flag as a Column which checks whether the relevant values >500 and then this could be the filter. How would this compare? Thank you
@SQLBI
@SQLBI 18 күн бұрын
Yes, see this article for the fundamentals: www.sqlbi.com/articles/filter-arguments-in-calculate/
@attaurrahman1880
@attaurrahman1880 19 күн бұрын
Thank you for Sir
@marcomapelli5953
@marcomapelli5953 19 күн бұрын
Molto interessante! C'è un elenco di queste "regole fondamentali" da qualche parte?
@gurvindersingharora5301
@gurvindersingharora5301 13 күн бұрын
Hello Alberto Sir, A lot of people are creating Pareto Chart in Power Bi Using various techniques of DAX. What will be yours ?? Please Create a Video of it !! ❤
@SQLBI
@SQLBI 13 күн бұрын
You have a full pattern here: www.daxpatterns.com/abc-classification/
@douglascory
@douglascory 19 күн бұрын
I always found it weird when people used FILTER inside a calculate, like I always thought: There must be a reason they are using it, since calculate already filters Nope, turns out it was just wrong lol
@pillslifestylereviews6714
@pillslifestylereviews6714 19 күн бұрын
The screenshot perfectly describes me when DAXing...
@workstuff5253
@workstuff5253 19 күн бұрын
Slightly off the topic (but still related). I suspect some of the reasons are based on requirements to enable a better demonstration, but is there an advantage to having DAX calculate the sales value (net price * quantity) over having the value calculated in an ETL process and having the value stored in the model as a further column.
@SQLBI
@SQLBI 19 күн бұрын
Usually you save memory thanks to a better compression, unless you have billions (not millions) of rows, in which case the difference is negligible and the perf improvement of a single column is relevant (it is not with millions of rows).
@Superninja1211
@Superninja1211 19 күн бұрын
Billion !!!... not Million !!!.... But other than that thanks. Very helpful!
@amitsatnalika5760
@amitsatnalika5760 19 күн бұрын
this problem of intersecting expanded table arises bcz we have two fact tables here and we are using these two together inside a single calculate, we can use these in two separate calculate and add those measure............................................................................................ what if if we have only one fact table , there expanded tables helps , let say in case where we have a measure associated with a dimension table and we need to respect filter coming from other dimension table , in that case only table filter or expanded table is the rescue.
@SQLBI
@SQLBI 19 күн бұрын
Normal filter propagation in that case doesn't require the expanded table. The example in the video is a simplification of a more complex real-world case scenario where table filters are applied on high-level measures, and down the hierarchy of nested measures in the calculation you could have a similar situation like the one described in the video, but in a more complex scenario where the presence of the issue is less obvious and much harder to investigate.
@Milhouse77BS
@Milhouse77BS 19 күн бұрын
Always interested when I hear “never”.
@mathew9665
@mathew9665 18 күн бұрын
Interesting - how about a filter around a number of summarised columns like: VAR _FilteredWithoutFees = FILTER ( SUMMARIZECOLUMNS ( 'Sales'[AdminFee], 'Sales'[IsVoided], TransTypes[TransType] ), 'Sales'[AdminFee]
@SQLBI
@SQLBI 18 күн бұрын
The filter over columns in AND condition should be always split by column. Try to apply this filter to a CALCULATE with a non-additive measure (e.g. DISTINCTCOUNT, apply YTD, or use a bidirectional relationship) and you'll see the impact.
@mathew9665
@mathew9665 17 күн бұрын
@@SQLBI Thank you kindly - I don't understand how to use filter columns then build it into an in memory table. - what would be the best method to use in this type of requirement
@SQLBI
@SQLBI 16 күн бұрын
We suggest that you review the foundational concepts - use this free course to start: www.sqlbi.com/p/introducing-dax-video-course/
@mathew9665
@mathew9665 9 күн бұрын
@@SQLBI Thank you after posting - I did a lot of testing of the basic calculate filter - it works and a lot quicker
@frasermartens3976
@frasermartens3976 18 күн бұрын
Honestly, I sometimes think Microsoft should just completely remove the ability to filter a table. What's even the point of having this unnecessary and clumsy function in the language at all? Is there some arcane use case that it needs to be kept to address?
Best practices for using KEEPFILTERS in DAX
28:24
SQLBI
Рет қаралды 11 М.
Filter context in DAX explained visually
24:40
SQLBI
Рет қаралды 22 М.
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 96 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 819 М.
Row Context in DAX
20:42
SQLBI
Рет қаралды 98 М.
When are variables evaluated in DAX
26:36
SQLBI
Рет қаралды 11 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 397 М.
Solving errors in CALCULATE filter arguments
30:55
SQLBI
Рет қаралды 29 М.
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 147 М.
Say Goodbye to Manual Calendars with This Excel Trick (File Included)
12:20
MyOnlineTrainingHub
Рет қаралды 39 М.
Top 10 Power BI Features You Should Be Using Right Now!
17:24
How to Power BI
Рет қаралды 43 М.
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 96 МЛН