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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
henkplus
Regular Visitor

Sort all values (numeric) in matrix using DAX

- Question: How to sort all values in matrix using DAX? Goal: pick N highest / lowest values with relevant dimensions.

- Description: Matrix Trenddev has 2 dimensions: year (number) and location (number). The values (%) in the matrix represent the deviation between: (1) the actual value (measure, based on the actual value for that specific location and year), and (2) the calculated value  based on the linear trend (measure using the actual data for the analysis period).

- Analysis period (start and end year): variable thru a slicer, max 18 years.

- Number of locations: max 3.000.

- Goal: get the N values (N = e.g. 5 or 10) with the highest (positive) / lowest (negative) values. In other words: where has the largest deviation occurred and when? For the outcome I need the value + location and year in order to be able to do further research into the how and why.

- Example: the attached Excel example is simplified for illustration and reference.Matrix Trenddev.png

Your help is highly appreciated.

2 REPLIES 2
henkplus
Regular Visitor

Thnx for your reply.

Unfortunately I'm afraid I don't follow you in your first step.

Can you show what you mean with your first step?

If you have help for creating that measure that would be nice too.

Thanks.

wdx223_Daniel
Community Champion
Community Champion

try these two steps

1, put both Locations and Year fields in the row

2, create a measure with RANKX to filter the visual

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.