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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.