NEW MEASURES: ALLEXCEPT = //This measure removes any filters coming from the Geography table EXCEPT a filter placed on the ShipCountry field// CALCULATE([Gross_Sales],ALLEXCEPT('Geography','Geography'[ShipCountry])) BelgiumSales = //This measure displays the sales for Belgium// CALCULATE([Gross_Sales],'Geography'[ShipCountry]="Belgium") CALCULATENoArguments = //demonstrates passing of row context to filter context// CALCULATE([Gross_Sales]) CustomersPlacingOrders = DISTINCTCOUNT('Orders'[CustomerID]) Deltabetwcosts = //This measure computes the delta between the Retail Unit Price and the Unit Cost.// SUMX('Product', 'Product'[Retail Unit Price]-'Product'[Unit Cost]) ErnstHandel = //This measure always displays sales for Ernst Handel// CALCULATE([Gross_Sales], 'Customers'[CompanyName]="Ernst Handel") Gross_Sales = //This measure adds up the Line_Item_Total column in 'Orders Details'// SUM('Orders Details'[Line_Item_Total]) Gross_Sales_As_Measure = //This measure displays the same value as the measure Gross_Sales. It is an iterator.// SUMX('Orders Details','Orders Details'[Quantity] * 'Orders Details'[UnitPrice]) Gross_Sales_ALLSELECTED = //This measure computes whatever gross sales for the attribute, taking into consideration all selections in the outer filter context (filters/slicers).// CALCULATE([Gross_Sales],ALLSELECTED()) Gross_Sales_%v1 = //This measure calculates the % of sales represented by the selected attribute (category, product, supplier, customer).// DIVIDE([Gross_Sales],[TotalSalesv1]) Gross_Sales_%v2 = //This measure calculates the % of gross sales represented by the attribute(s) REFLECTED by whatever is selected in a filter and/or slicer on the page.// DIVIDE([Gross_Sales],[Gross_Sales_ALLSELECTED]) IteratingNoDupes = //This measure demonstrates iterating over a dim table rather than a fact table// SUMX( 'Orders',SUM('TestTableDupes'[Line_Total])) Line_Total_As_Measure = //This measure calculates the line total in the Raw Data table.// SUMX('Raw data','Raw data'[Quantity]*'Raw data'[UnitPrice]) ORDERIDTOTAL = //This measure uses the Orders table as a DIM table to eliminate duplicates// CALCULATE([Gross_Sales],ALLSELECTED('Orders'[OrderID])) OrderofEvaluationv1 = //This measure demonstrates order of evaluation// CALCULATE([Gross_Sales],'DateDim'[Year]=2020) OrderofEvaluationv2 = //This measure shows the order of evaluation// CALCULATE( CALCULATE([Gross_Sales],ALL('DateDim'[Year])), 'DateDim'[Year]=2020) SalesbyRequiredDate = //This measure calculates sales using the RequiredDate column in the Orders table// CALCULATE([Gross_Sales],USERELATIONSHIP(Orders[RequiredDate],'DateDim'[Date])) SalesbyShipDate = //This measure calculates sales using the ShipDate column in the date table// CALCULATE([Gross_Sales],USERELATIONSHIP(Orders[ShippedDate],'DateDim'[Date])) SalesforUSASuppliers = //This measure shows the sales from Suppliers in the USA// CALCULATE( [Gross_Sales], Product[SupplierID] IN { 19,16,3,2}) SalesforUSASuppliersKEEPFILTERS = //This measure shows the sales from Suppliers in the USA// CALCULATE( [Gross_Sales], KEEPFILTERS(Product[SupplierID])) TotalSalesBySupplier = //This measure computes the total gross sales across all the suppliers.// CALCULATE([Gross_Sales],ALL(Suppliers)) TotalSalesforBeverages = //This measure computes sales for the Beverage category.// CALCULATE([Gross_Sales], 'Categories'[CategoryName]="Beverages") TotalSalesforBeveragesv2 = //This measure will not work (but it won't generate an error) because we have two Boolean conditions stipulated.// CALCULATE([Gross_Sales], 'Categories'[CategoryName]="Beverages" || "Condiments") TotalSalesforBeveragesv3 = //This measure will not work (even though it does not generate a DAX error) because there are two Boolean conditions.// CALCULATE([Gross_Sales], 'Categories'[CategoryName]="Beverages" , 'Categories'[CategoryName]= "Condiments") TotalSalesforBeveragesv4 = //This measure will not work because there are two Boolean conditions.// CALCULATE([Gross_Sales], 'Categories'[CategoryName]="Beverages" , 'Employees'[EmployeeID]= "1") TotalSalesv1 = //This measure calculates the total value for Sales across all the categories.// CALCULATE([Gross_Sales], ALL('Categories')) TotalSalesv1RF = //This measure computes the cumulative total sales for every category.// CALCULATE([Gross_Sales], REMOVEFILTERS('Categories')) TotalSalesv2 = //This measure computes the sales for all products.// CALCULATE([Gross_Sales],ALL('Product')) TotalSalesv2RF = //This measure computes total sales for all products. It is the same as TotalSalesv2.// CALCULATE([Gross_Sales],REMOVEFILTERS('Product')) TotalSalesv3 = //This measure computes total sales regardless of any filters present.// CALCULATE([Gross_Sales],ALL()) TotSalesBevv2 = //This measure makes explicit what happens "under the covers" with CALCULATE.// CALCULATE([Gross_Sales], FILTER( ALL('Categories'[CategoryName]), 'Categories'[CategoryName]="Beverages")) NEW COLUMNS: CColv1 = //This creates a new calculated column in the Product table.// SUM('Product'[Retail Unit Price])-SUM('Product'[Unit Cost]) CalColv2 = //This creates a calculated column in the Product table.// 'Product'[Retail Unit Price]-'Product'[Unit Cost] NEW TABLES: TestTablewnoDupes = //SUMMARIZECOLUMNS is not an iterator, so no duplicate lines will get added to TestTable2// SUMMARIZECOLUMNS('Raw data'[OrderID],'Raw data'[Line_Total]) TestTableDupes = //This creates a new table with some duplicates because FILTER is an iterator.// FILTER('Raw data','Raw data'[OrderID] IN {10248, 10249, 10250, 10257})