After that, well calculate the Total Sales using SUMX. Sam is Enterprise DNA's CEO & Founder. DAX Syntax Reference For now, just focus on how CONCATENATEX uses the result provided by TOPN: the Product Name column reference uses Product as a table name. Going through this will be a good learning experience for me - can I ask how you'd do this with my original approach as well? In this case, we have no other filters on our data. Variance, [Forecast Variance], VAR B = And that is actually how you can internally iterate some logic through a virtual table and evaluate the particular results. [Forecast_OrdersQty], Without using variables, the measure can be as follows: You may notice that the Sales Amount measure is evaluated twice for the top three products found. I am using this to filter the series of seat numbers created by GENERATESERIES. This way, you can gauge if a customer has been good or bad based on this one factor, instead of factoring in three to ten variables. For more information, see Measures in Power BI Desktop (Organizing your measures). In other words you will have multiple rows and the values in the [Dest] column will be repeated but each row will be unique. Filtering functions let you manipulate data context to create dynamic calculations. From my Locations table, I have a relationship which flows down to my Sales table. Format your DAX! When you store a scalar value in a variable, the behavior is intuitive and common to many other languages. However, what happens if we assign the result of TOPN to a variable? RELATED Vs LOOKUPVALUE DAX in Power BI. The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. A column reference must always reference an existing column of the data model, or a column that has been generated using a table function assigning a specific name to it. The returned table has one column for . Returns a table by removing duplicate rows from another table or expression. I use the term algorithms because you can expand on this and make it even more advanced. You can now see the output of the algorithm we have just created and utilize it in our analysis. VAR Test2 = GENERATEALL(SeatBookings, CustomerSeatBookings), Gives an error "Function GENERATEALL does not allow two columns with the same name 'SeatBookings'[Customer]. Suppose you use a DAX table variable, such as to group by certain columns and add an extension column as a calculation. Based on this new table, we are finally going to calculate the Total Sales. Indeed, there is no measure named Sales in the model. And because we used SUMX, this table will only look for those good customers that have bought over 5000. Assigned to every column in a table, this tag identifies the original column in the data model that the values of a column originated from. The second syntax returns a table of one or more columns. as of now TABLE/COLUMN are only available for querying the model and not for enriching the model. Return wrong results which is a cartisian product of tables. Making statements based on opinion; back them up with references or personal experience. Virtual tables are a unique analytical technique that you can use to visualize interesting insights inside Power BI. CONCATENATEX ( ,