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

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

Reply
Anonymous
Not applicable

column header sorting in Direct Query

Hi folks,

I have a fact tabel, person table and dates table in connection with direct query. I want to sort column header in result table as given screenshot below in direct query mode. also there is year filter applied to this result table.

Will appreciate it if any help.

Thank you.

 

 

Direct Query data source

directquery data.JPG

 

Result Table

result.JPG

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could pivot "WeekHeader" column and use sum of "Values" as value.

Or you could use matrix visual to show your data, you need to put "WeekHeader" column in the "Columns" section.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Hi @v-eachen-msft ,

 

Thanks for your response on this issue.

Obviously, I can use a matrix or pivot the column in power query for this visual, but the issue is here to sort header like in result visual.

for example, in visual I have column header in ascending order "week of Jan 1, week of Jan 2, week of Jan 3, week of Feb 1, week of Feb 2, week of Feb 3.......week of Oct 1, week of Oct 2, week of Oct 2, week of Nov 1, week of Nov 2, week of Dec 1, week of Dec 2, week of Dec 3". and when I select any 3 months, for example, Aug, Sep, Oct from month slicer for any particular year 2019 then column header should show week of Oct 3, week of Oct 2, week of Oct 1, week of Sep 3, week of Sep 2, week of Sep 1, week of Aug 3, week of Aug 2, week of Aug 1.

can we solve this issue by using a matrix and pivot the column header in this case?

 

Hi @Anonymous ,

 

I am afraid that column header doesn't support "sort" feature.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Folks, is there any solution in Power BI?

Hi @v-lid-msft , please help with this issue?

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.

Top Solution Authors