Forum Discussion

zervino's avatar
zervino
Helper I
2 years ago
Solved

Waterfall chart with specific breakdown order

I want to create a waterfall chart with this structure:       Year Team Volume 2022 A 50 2022 B 30 2022 C 20 2023 A 80 2023 B 15 2023 C 30   I want...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi zervino ,

     

    I apologize for misunderstanding your point. By design, it is not possible to sort by column when both the sort field and the breakdown field have values. Here is an alternative solution:

    (1)We can create two tables.

     

    Table 2 = UNION(VALUES('Table'[Team]),VALUES('Table'[Year]))
    Table 3 = DATATABLE ( 
        "Team", STRING, "Index", INTEGER,
        {
            { "2022", 1 },
            { "A", 2 },
            { "B", 3 },
            { "C", 4 },
             { "2023", 5 }
        }
    ) 

     

    We can create a column in Table2.

     

    Volume = 
     var _a= CALCULATE(SUM('Table'[Volume]),FILTER('Table',[Year]=EARLIER('Table 2'[Team])))
     var _b=CALCULATE(SUM('Table'[Volume]),FILTER('Table',[Team]=EARLIER('Table 2'[Team]) && [Year]="2023"))
     var _c=CALCULATE(SUM('Table'[Volume]),FILTER('Table',[Team]=EARLIER('Table 2'[Team]) && [Year]="2022"))
     return IF(_a=BLANK(),_b-_c,_a)

     

    We can create a model relationship.

    Select the Team column of the [Table 3] table and sort by the Index column.

    Place the Team column of the [Table 3] table on the visual object.

    However, the color of the columns will not be consistent with your expected color, which is due to the design. If you would like to give feedback and suggestions on Power BI Desktop features, you can post ideas to the IDEA forum.

     

    Best Regards,

    Neeko Tang

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