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
VR_123
Frequent Visitor

Matrix - Sort the Cost by latest Quarter and Show Total Cost of 4 Quarters

Hi Team,

I have the cost details for 4 Quarters in 2020.

Requirement: Matrix to represent 4 Quarters data along with Total

1. Cost - Sort by Current Quarter (Q4) from higher to lower

2. Total - Should addup to sum of 4 quarters (Instead of last Quarter)

 

Please refer the below screen shotLatest Qtr Sort.png

 

 

Source Data Preview:

Data Prev.PNG

Thanks in Advance🙂

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @VR_123 ,

 

Try this:

 

1. Create a measure with short name.

1 = CALCULATE(SUM('Table'[Value]),'Table'[Qtr]="Q4")

 

2. Put the measure into your matrix visual and sort by it.

measure 1.JPG

 

3. Set Field Formatting of measure 1.

1.JPG

 

 

Best Regards,

Icey

 

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

2 REPLIES 2
Icey
Community Support
Community Support

Hi @VR_123 ,

 

Try this:

 

1. Create a measure with short name.

1 = CALCULATE(SUM('Table'[Value]),'Table'[Qtr]="Q4")

 

2. Put the measure into your matrix visual and sort by it.

measure 1.JPG

 

3. Set Field Formatting of measure 1.

1.JPG

 

 

Best Regards,

Icey

 

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

amitchandak
Super User
Super User

@VR_123 , Create columns like there

 

Qtr 1 = [qtr]

Rank = Rankx(all(Table]), [qtr],,desc,dense)

 

then sort qtr 1 on rank and use that as a column in matrix

Refer  for steps: https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

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.