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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JamesBowdidge
Frequent Visitor

Matrix with date in colum header - set to descending?

Hi,

 

matrix date in col header is driven by calculated calendar and works perfectly. Except the oldest date is on the far left and user has to scroll all the way to the right to see latest data.  All we want to do is set the date the other way around.. and prevent all this unnecessary scrolling.. 

 

We have tried multiple fixes that have been suggested but nothing we do works, like this one adding the index col  https://community.powerbi.com/t5/Desktop/Sort-Date-Column-in-Matrix/m-p/602217

 

It doesnt matter how the calendar is sorted in the data veiw, the matrix headers will not change.. 

 

Feels like a really stupid problem to have, any help appreciated

 

thanks

 

J

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @JamesBowdidge ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1683018431335.png

vjianbolimsft_1-1683018460074.png

Please try:

First create a calendar table like this:

Calendar = 
var _a = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
var _b = MAX('Table'[Date])
return ADDCOLUMNS(_a,"ORDER",DATEDIFF([Date],_b,DAY))

vjianbolimsft_2-1683018530090.png

Then sort by column:

vjianbolimsft_3-1683018552302.png

Manage relationship:

vjianbolimsft_4-1683018571212.png

Final output:

vjianbolimsft_5-1683018587085.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @JamesBowdidge ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1683018431335.png

vjianbolimsft_1-1683018460074.png

Please try:

First create a calendar table like this:

Calendar = 
var _a = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
var _b = MAX('Table'[Date])
return ADDCOLUMNS(_a,"ORDER",DATEDIFF([Date],_b,DAY))

vjianbolimsft_2-1683018530090.png

Then sort by column:

vjianbolimsft_3-1683018552302.png

Manage relationship:

vjianbolimsft_4-1683018571212.png

Final output:

vjianbolimsft_5-1683018587085.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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