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
NJ81858
Helper IV
Helper IV

Sort by Changes Measure Results

Hello,

 

I have a report that shows sales totals for different categories, as well as the amount and percent change from the most recent date to the other dates. This is what my visual currently looks like:

PBI Matrix1.PNG

 

The measures that make up the visual are the following:

Total = SUM('Table'[Amount])

Change from = CALCULATE([Total],'Table'[Date]=MAXX(ALL('Table'[Date]),[Date]))-[Total]

% Change from = DIVIDE([Change from],CALCULATE([Total],'Table'[Date]=MAXX(ALL('Table'[Date]),[Date])))

 

The issue with my visual in it's current position is that I need the most recent date to be on the left, with the date sorting descending from left to right instead of ascending from left to right. I created an Index that will sort the dates in descending order, but when I sort the dates, my visual turns into this:

PBI Matrix2.PNG

 

I have tried to follow the instructions explained in this post: https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...  , but it doesn't end up changing anything. After changing the measures to follow the post's instructions, they look like this:

Total = SUM('Table'[Amount])

Change from = CALCULATE([Total],'Table'[Date]=MAXX(ALL('Table'[Date], 'Table'[Index]),[Date]))-[Total]

% Change from = DIVIDE([Change from],CALCULATE([Total],'Table'[Date]=MAXX(ALL('Table'[Date], 'Table'[Index]),[Date])))

 

Any help would be greatly appreciated! Thank you in advance!

0 REPLIES 0

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.