Forum Discussion
Jyaulhaq
1 year agoFrequent Visitor
Promote Headers via dax or not use function Promote headers
Hi, I have Sales Table country wise : how can I create new table with First row as header using 1. DAX 2. not using function Promote Headers(at Power query) Output: Note: ...
- 1 year ago
Hi Jyaulhaq ,
Thank you for the update. DAX can’t dynamically promote headers when you have n number of columns. Any DAX approach would require listing each column manually, so it won’t update automatically if columns change.
If you need it to work dynamically, the only option is to do it in Power Query or make sure the source already has the correct headers before loading.
Best Regards,
Community Support Team
rohit1991
Super User
1 year agoHi Jyaulhaq
You can create a new calculated table with corrected headers using the DAX formula below:
Note: I have used a dummy table named 'Sample Data' please replace it with your actual table name.
Steps:
1. Go to Model View in Power BI.
2. Click on New Table and paste the following DAX:
SalesFinal =
SELECTCOLUMNS (
FILTER ( 'Sample Data', 'Sample Data'[Column1] <> "Country" ),
"Country", 'Sample Data'[Column1],
"Sales", 'Sample Data'[Column2],
"Date", 'Sample Data'[Column3]
)
Output: