Forum Discussion
Sort Axis on Waterfall Chart
Syndicate_Admin Well, I think that the column would look something like the following. PQ only supports if then else statements so it is a bit messy but for a limited number of categories it should work. This would be entered into an Add Custom Column formula (without the = sign):
=
if [BREAKDOWN] = "Mg Serv" then 1 else
if [BREAKDOWN] = "Mg Eq" then 2 else
if [BREAKDOWN] = "C. Op" then 3 else
if [BREAKDOWN] = "C. Com" then 4 else
5
It's in my Categories column (created in Power Query)
if [Year] = 2025 and List.Contains(
{"A. Service Income", "B. Service Cost D", "C. Electricity", "D. Equipment Revenue", "E. Equipment Cost", "F. Commercial Cost", "G. Serti Operational Cost"},
[Line Template]
)
then
if [Income Type] = "PLAN" then "Mg Contribution 2025P"
else if = "REAL" and [Month] <= 6 then "Mg Actual Contribution"
else if = "OL" and [Month] >= 7 then "Mg Real Contribution"
else null
else null
This is my Breakdown column (created in Power Query)
if [Year] = 2025 then
Mg Services
if List.Contains({"01. Income Services","02. Costs of Services"}, [Line Cost N1]) then
if [Income Type] = "PLAN" then "2. δ mg services"
else if = "REAL" and [Month] <= 6 then "2. δ mg services"
else if = "OL" and [Month] >= 7 then "2. δ mg services"
else null
Mg Equipment
else if List.Contains({"04. Income from the sale of equipment/products","05. Equipment Costs"}, [Line Cost N1]) then
if [Income Type] = "PLAN" then "3. δ mg equipment"
else if = "REAL" and [Month] <= 6 then "3. δ mg equipment"
else if = "OL" and [Month] >= 7 then "3. δ mg equipment"
else null
// C. Oper. VP Digital
else if [Line Template] = "F. Trade Cost" then
if [Income Type] = "PLAN" then "4. Δ C. Op. VP Digital"
else if = "REAL" and [Month] <= 6 then "4. Δ C. Op. VP Digital"
else if = "OL" and [Month] >= 7 then "4. Δ C. Op. VP Digital"
else null
C. Commercial
else if [Linea Template] = "G. Cost-Operational Serti" then
if [Income Type] = "PLAN" then "5. Δ C. Commercial"
else if = "REAL" and [Month] <= 6 then "5. Δ C. Commercial"
else if = "OL" and [Month] >= 7 then "5. Δ C. Commercial"
else null
else null
else null
This is my measure Amount (created with DAX)
The values are correct and square, and the Category column is sorted correctly, the problem I have is with the Breakdown column. You guide me how to implement an order that is maintained, regardless of the months or products that I filter
- GeraldGEmerick11 months agoSuper User
Syndicate_Admin Right, so then you need to create another Breakdown Sort column that references each unique value in your Breakdown column and assigns a number to it.