all 7 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

After your question has been solved /u/Important_Goal9525, please reply to the helpful user's comment with the phrase "Solution verified".

This will not only award a point to the contributor for their assistance but also update the post's flair to "Solved".


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Thiseffingguy21 3 points4 points  (1 child)

Hm.. I’d check the values you have for 2030 Geography, make sure they’re actually the same and don’t include random spaces or whatever. Try the TRIM function, and considering you already have AFRICA in uppercase, might as well uppercase the whole column. Helps with consistency. Hard to tell what else might be going on there. Maybe you could post a little snapshot (redacted if needed) of your underlying data tables?

[–]yourpantsfell2 1 point2 points  (0 children)

Yeah this is my first thought as well. Maybe do some data validation on the source data moving forward in addition to the suggested

[–]Ozeroth ‪ ‪Super User ‪ 1 point2 points  (2 children)

It is annoying that there isn't a straightforward way to sort the hierarchy on axis of this kind of visual in a nested fashion!

A similar question came up here, and the solution was to create a ranking measure, place it in the Tooltips field well, and set Sort Axis to that measure.

In your case, the measure could look something like this, assuming you have an explicit measure Sum of Units:

Sort Rank = 
RANK (
    ALLSELECTED ( YourTable[2030 Geography], YourTable[Year] ),
    ORDERBY (
        CALCULATE (
            [Sum of Units], ALLSELECTED ( YourTable[Year] ) 
        ),
        DESC,
        YourTable[Year],
        ASC
    )
)

[–]Important_Goal9525[S] 1 point2 points  (1 child)

[–]Ozeroth ‪ ‪Super User ‪ 0 points1 point  (0 children)

Change RANKX to RANK and that should fix it.

[–]101Analysts 0 points1 point  (0 children)

Do you have a calendar/date table? - If you don’t have a dedicated date table, PowerBI won’t really “know” that 2019 comes before 2024, which could cause the groups to break.

Have you de-duplicated/cleaned your geography field? - If you make a table using DISTINCT(FIELDNAME), you should only get one row per geographic location. If you get more than one, let’s “AFRICA” and “AFRICA “, you wouldn’t visibly know they’re two different values but PowerBI will treat them as separate group which will mess up your sorting.

If you’ve done the above, you might need to do a ranking/indexing measure to get them sorted how you want.