Wednesday, May 28, 2025

Power BI: Creating a New Table from an Existing Table with Filter Conditions Using DAX

 In Power BI, you can create a new table from an existing one using DAX with specific filter conditions. This is done using functions like FILTER, SELECTCOLUMNS, or ADDCOLUMNS to include only the desired rows. It’s a powerful way to generate custom views of your data for reporting or analysis. This method helps keep your data model clean and focused on relevant insights.


Steps to create a new table from an existing one using DAX with specific filter conditions:

  1. Below is the main table from which we will create another table using the SUMMARIZE function along with a FILTER condition


  2. Use the code below to create a new table from the main table with a filter condition. E.g. Region = “USA”

    SalesData_USA =

SUMMARIZE (

    FILTER ( SalesData, SalesData[Region] = "USA" ),

    SalesData[Year],

    SalesData[Region],

    SalesData[SalesAmount]

)

  1. Below is the newly created table that contains data for the USA region only.


No comments:

Post a Comment