Загрузка...

Day27 - Power Pivot - DAX - Summarize and RankX Functions

Here are the explanations and examples of the SUMMARIZE and RANKX functions in Power BI DAX without using filter. The SUMMARIZE function:::::::::::::::::::::::::::::::::::::::: The SUMMARIZE function in DAX is used to group data in a table based on one or more columns and create a summary table. It allows you to aggregate data and create new columns based on calculations. The basic syntax of the SUMMARIZE function is: SUMMARIZE( table, group_column(s), aggregate_expression(s) ) Where table -- is the name of the table you want to summarize, group_column(s) -- are the columns by which you want to group the data, aggregate_expression(s) -- are the calculations that you want to perform on the grouped data. Here is an example: Suppose you have a table named "Sales" with columns "Product", "Region", "Month", and "SalesAmount". You can use the SUMMARIZE function to create a summary table that shows the total sales amount for each product and region combination: SalesSummary = SUMMARIZE( Sales, Sales[Product], Sales[Region], "TotalSalesAmount", SUM(Sales[SalesAmount]) ) In this example, the Sales table is summarized by the Product and Region columns. The TotalSalesAmount column is created using the SUM function to calculate the total sales amount for each group. The RANKX function::::::::::::::::::::::::::: The RANKX function in DAX is used to rank values in a table based on a specific measure. It assigns a unique rank number to each value based on its position in the sorted list. The basic syntax of the RANKX function is: RANKX( table, expression, [value], [order] ) Where table -- is the name of the table you want to rank, expression -- is the measure or calculation that you want to rank, [value] is the value to rank, and [order] is the order of the ranking (either ascending or descending). Here is an example: Suppose you have a table named "Sales" with columns "Product", "Region", "Month", and "SalesAmount". You can use the RANKX function to rank the sales amount for each product and region combination: SalesRank = RANKX( Sales, SUM(Sales[SalesAmount]), , DESC ) In this example, the RANKX function is used to rank the sales amount for each row in the Sales table in descending order. The result is a new column named SalesRank that contains the rank number for each row based on the total sales amount. Note that in both examples, no filter is used to restrict the data to be summarized or ranked. Instead, the entire table is used for these operations.

Видео Day27 - Power Pivot - DAX - Summarize and RankX Functions автора Бизнес-аналитика: программное обеспечение и тренды
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки