Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ERing
Post Partisan
Post Partisan

How can I modify this DAX query to alias the column headers?

I received a request to have a daily email scheduled to send users a CSV export of a table visual in one of my reports. I followed some online guideance to set up a flow using Power Automate and the query copied from running the performance analyzer on the specific table visual.

The remaining challenge is that the headers in the CSV are showing the table name[column name]. The users have requested that only the column name be present. Is there anyway I modidy the query below to alias the header names so they are just ID, Customer Name, Location, and Product Type?

// DAX Query
DEFINE
VAR __DS0FilterTable = 
FILTER(
KEEPFILTERS(VALUES('DIM_CALENDAR'[DATE])),
AND('DIM_CALENDAR'[DATE] >= DATE(2024, 2, 4), 'DIM_CALENDAR'[DATE] < DATE(2024, 2, 6))
)
 
VAR __DS0Core = 
CALCULATETABLE(
SUMMARIZE(
'Table',
'Table'[ID],
'Table'[CUSTOMER_NAME],
'Table'[LOCATION],
'Table'[PRODUCT_TYPE]
),
KEEPFILTERS(__DS0FilterTable)
)
 
VAR __DS0PrimaryWindowed = 
TOPN(
501,
__DS0Core,
'Table'[ID],
1,
'Table'[CUSTOMER_NAME],
1,
'Table'[LOCATION],
1,
'Table'[PRODUCT_TYPE],
1
)
 
EVALUATE
__DS0PrimaryWindowed
 
ORDER BY
'Table'[ID],
'Table'[CUSTOMER_NAME]
'Table'[LOCATION],
'Table'[PRODUCT_TYPE]
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @ERing ,

 

Your question is actually more of Power Automate than Power BI. When you run a query against a Power BI Dataset in Power Automate, the result always includes the table name and the column. To change the name,  you must add another action called Select which you can use to a custom column name onto the table/column/measure. Enter the desired column name in the first column and in the second, write an expression similar to below:

danextian_4-1707288564403.png

 

Carpark is the Table while Carpark Number is the column. If referencing a measure, you can write something like @item()?['[Volume]'] where Volume is the name of the measure.

 

You then need to add another action called Create CSV table where the input is the output from the previous step.  The output of this action is what you send to the recepients. For more information, I would suggest you visited the Power Apps forum.

danextian_3-1707288506465.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @ERing ,

 

Your question is actually more of Power Automate than Power BI. When you run a query against a Power BI Dataset in Power Automate, the result always includes the table name and the column. To change the name,  you must add another action called Select which you can use to a custom column name onto the table/column/measure. Enter the desired column name in the first column and in the second, write an expression similar to below:

danextian_4-1707288564403.png

 

Carpark is the Table while Carpark Number is the column. If referencing a measure, you can write something like @item()?['[Volume]'] where Volume is the name of the measure.

 

You then need to add another action called Create CSV table where the input is the output from the previous step.  The output of this action is what you send to the recepients. For more information, I would suggest you visited the Power Apps forum.

danextian_3-1707288506465.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextianVery helpful! Thanks very much!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.