I have a table with columns A, B, C, D, E. How to create another table in Power BI using…
- User
I have a table with columns A, B, C, D, E. How to create another table in Power BI using DAX to get columns A, B, C, and values where D = 1
- Assistant
To create another table in Power BI using DAX where the value of column D is 1, you can follow these steps:
-
Open Power BI and go to the "Modeling" tab in the ribbon.
-
Click on "New Table" under the "Tables" group.
-
In the formula bar, enter the following DAX formula to create the new table:
codeNewTable = FILTER(YourTable, YourTable[D] = 1)Here, "YourTable" should be replaced with the actual name of your existing table.
- Press Enter to create the new table.
Now, the new table "NewTable" will only contain the columns A, B, C from your original table where the value of column D is 1. You can use this table in visualizations and further analysis in Power BI.
-
- User
But I do not need a column E
- Assistant
If you don't need column E in your new table, you can modify the DAX formula to exclude it. Here's the updated formula:
codeNewTable = FILTER(YourTable, YourTable[D] = 1) SELECTCOLUMNS(NewTable, "A", YourTable[A], "B", YourTable[B], "C", YourTable[C])This formula first filters the original table based on the condition "D = 1". Then, the SELECTCOLUMNS function is used to select only columns A, B, and C from the filtered table. The resulting new table will only include columns A, B, C without column E.