cancel
Showing results for
Did you mean:
Frequent Visitor

## Issue with sorting a matrix columns

Hi everyone,
I had a request to have totals of x months on the left side of a matrix table. like in the example below.

After researching, I found a method that worked with this article. https://4pbi.com/power-bi-matrix-totals-on-the-left/ Which requires creating a calculated table with distinct values of the lifetime in months.
Totalstable = UNION(
))

and then I have to create the following measures.

2_months= IF(SELECTEDVALUE('Totalstable '[lifetimeInMonths]) = " 2 months", 1, 0)

SalesWithTotal = IF([2_months], CALCULATE(SUM(Sales[Sales]), 'Totalstable '[lifetimeInMonths] in {1,2}, SUM(Sales[Sales]))
This works, However, since the calculated column lifetimeInMonths is now a text field, I now have a issue with sorting it the right way.
I created a lookup table like this to help with the sort. But for whatever reason, my measure SalesWithTotal then doesn't show my improvised 2_months result anymore

I have officially ran out of ideas. I tried some other things, and I got circular dependency errors.

I'm truly looking forward to your help.

Best regards.

1 ACCEPTED SOLUTION
Super User

See if this helps:

Creating a Hybrid or custom matrix

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

3 REPLIES 3
Frequent Visitor

@PaulDBrown, this solution worked me. Soo grateful 🙂

Super User

See if this helps:

Creating a Hybrid or custom matrix

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Super User

ypu can create a second column and sort the table using that column as reference, them when used on the visual you will have that exact order on the table put it directly on the table column and get a blank square on top of the visual group it and there you go 😛

Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!

Announcements

#### Launching new user group features

Learn how to create your own user groups today!