Learn and optimize DAX with Marco Russo and Alberto Ferrari - Visit www.sqlbi.com/?aff=yt.
We are experts on DAX and Data Modeling for Power BI, Analysis Services, and Power Pivot. Visit our website to get more than 200 free articles, books, videos, and courses.
Free video courses:
- Introducing DAX: sql.bi/introdax/?aff=yt - Introduction to Data Modeling for Power BI: sql.bi/intromodeling/?aff=yt
Advanced video courses:
- Mastering DAX: sql.bi/masterdax/?aff=yt - Optimizing DAX: sql.bi/optimizedax/?aff=yt - Data Modeling for Power BI: sql.bi/modeling/?aff=yt - Power BI Dashboard Design Course: sql.bi/dashboard/?aff=yt - SSAS Tabular Course: sql.bi/tabular/?aff=yt - Power Pivot Workshop: sql.bi/powerpivot/?aff=yt
Our latest books:
- The Definitive Guide to DAX - 2nd edition: sql.bi/guidetodax/?aff=yt - Analyzing Data with Power BI and Power Pivot for Excel: sql.bi/modelingbook/?aff=yt
Mr. Ferrari, thank you sir. I wish I had found this video 40 minutes ago but very glad nonetheless. So clean and simple! Tried other methods/videos to no avail.
Good video and and agree with idea in behind, but what about Power BI tool it self? Is it easy to learn? Is it clear with what to start learn Power BI? Is it intuitive and how many exceptions in functionality need to keep in mind when You start to use it. So what is 20/80 needed to know in Power BI to get in average knowledge? Can be applied rules like 3/30/300 to Power BI tool it self? Sorry for to much questions above but its not fair that to create something simple and easy to read by going through madness to create it.
Excellent tutorial Kurt! Thanks to your clear guidance, it was easy to grasp how the reports could be more efficient and effective. Thank you for the content. Much appreciated!! Big fan of you guys :)
what is the purpose of using this: ISSELECTEDMEASURE (xxxx If you had another table and put total quantity on it, total quantity measure still changes. You have to stop interactions between the slicer and new table.
How do you filter a virtual table inside a measure using a selectedvalue from a disconnected slicer? The filtered table returns no data - as if the selectedvalue were returning multiple values - but it is not! If I put a default value in the selectedvalue variable it works as expected, and likewise if I return just the selectedvalue variable - it dynamically shows the value selected in the slicer. Yet the selected value doesn't seem to be recognized when used to filter the virtual table. Help!?
SELECTEDVALUE returns a single value, you should use VALUES to get all the selected values. Indeed, SELECTEDVALUE internally uses VALUES; as described in dax.guide/selectedvalue/
why can't I define a variable using selectedvalue from a disconnected slicer table to be used to filter a virtual table? It seems to think more than one value is being returned in the variable, when it is not. If I add a default value it works perfectly. If I return the selectedvalue variable it works perfectly, showing the selected value from the slicer. But when I try to filter the table using the selected value variable it returns no data. I know this is not a new issue, I just don't understand how to get around it! Help me Alberto - you're my only hope!
@@SQLBI Thank you for the reply. Unfortunately we cannot install without approval and without admin credential. I do have a separate question. I'm struggling to make this appen in Powerbi. I need to create a graph that allows users to enter range 1-5 of years. Then they select different type of periods last month, last 6 months, last quarter, last year. The result on the graph is to show previous comparisons going back the many years selected in the range. Do you have a vid or a guide that you can recommend? I'm only seeing yoy or 2 comparisons in my searches. Thank you in advance.
Let's not forget that if the year used from a calendar dimension table is sorted by some other column of that table, also this sorting column is part of the filter. I learned this lesson in the hard way 😢
Great explanation as always Marco. What is the reason in case I want to calculate sales amount that is not blue, but want to use color slicer and that gives me a static value and not filtered by the color slicer. Not Blue Measure = CALCULATE([Sales Amount], 'Product'[Color] <> "Blue"). I had to use KEEPFILTERS or FILTER in order to work and use the slicer. Thanks!
This video shows how to make changes to filter contexts, but how do we know what the initial filter context is? Is it always explicitly defined in a measure? I'm concerned certain visuals or default summarization settings implicitly define contexts that can't be easily seen by clicking measures and seeing their dax formulas. For example if i come across a visual, shoui ld look in the fields to find definitions of measures to understand the starting context? How to make sure all existing filters are accounted for exhaustively? What other places can they exist in? (This video shows filter pane is a source of existing context too) For overwriting/keeping contexts does it propagate through the entire lineage of definitions? For example 16:06 shows Bnechmark 2017 measure depends on another measure Sales 2017 which depends on Sales Amount.
The purpose of DAX is to enable writing measures that work in any context. You can explore the filter context for debugging purposes with the debugger integrated in Tabular Editor 3, or by creating a special measure in the tooltip (DAX Studio has a feature to create it automatically) as described in www.sqlbi.com/articles/displaying-filter-context-in-power-bi-tooltips/
7:45- why does Product to Brand need to be bi-directional? We have this second kind of bridge table in real estate: a borrower can have multiple collateral, and conversely, a collateral can be connected to multiple loan numbers (ie. pari-passu loans). So you need an intermediary loan-to-property code table between the Loan and Property tables. This is one-to-many-to-many-to-one, and it's uni-directional and it works just fine for Loan to filter Property.
3:00- bridge table type 1 (new information) (one-many--many-one) 7:30- bridge table type 2 (no new information) (many-one-one-many) (won't slow down your model if there are only a few hundred rows)
Should we always use KEEPFILTERS? My question is based on the assumption we cannot control if an user adds an external filters, for example just for filter a location or an year... if in our measure we use the "same filter", we overwrite the user filter... so isn't it safer to always use it?
Thank you for the great lecture sir. Sir, I have one doubt. Above this, it is very useful to see month-wise. I tried the above concept month-wise and it successfully worked. But if I filter by 'Date[Date] in sales amount by date wise in chart, it does not work. Will we be able to find date-wise information for the above concept, sir? For example, if I clicked June 2024 in Slicer, the table showed the last 3 month values. If I filtered by 'Date'[Date] in the date-wise sales amount in the chart, the matrix table did not show the date-wise filtered value. It shows only that month wise Value . Kindly, give me solution for this concept Sir.
Thanks for this article/video Marco. Filter context can be complicated, even for expert Dax developers. Articles like this are a must, getting back to the basics.
me costo un poco seguir el video ya que lo veo con subtitulos en español, asi que lo repeti y detuve hasta entender un poco... seria muy bueno que se pudiera traducir los videos a diferentes idiomas. Saludos desde Colombia.
Thanks for taking the time to test ChatGRT-4o vs DAX. It's one thing for a typical developer to give their opinion, it's another for the Godfather to do so 🙂.