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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.