Forum Discussion
mazwro
Helper II
2 years agoOrder a graph by month is not working with parameter
I have a parameter with date aggregation: week / month / quarter
Date Aggregation parameters = {
("WEEK", NAMEOF('date table (2)'[WeekStart]), 0),
("MONTH", NAMEOF('date table (2)'[MonthYearFormatted]), 1),
("QUARTER", NAMEOF('date table (2)'[QuarterFormatted]), 2)
}
MonthYearFormatted = FORMAT('date table (2)'[Date], "yyyy-mm")
WeekStart = CALCULATE(MIN('date table (2)'[Date]), ALLEXCEPT('date table (2)', 'date table (2)'[Week of Year], 'date table (2)'[Year]))
QuarterFormatted = 'date table (2)'[Year] & " / " & 'date table (2)'[Quarter]
This sum up sales for that time period.
But, when I click on month, the order is messed up. I can order it in PBI Desktop, but when I click on week and month again, the order is reset and I get this:, the choice of month makes the order of the graph by turnover and not date. But weeks and quarters order by date
How can I fix it?
mazwro ok, for each column, you need to do this:
1. Create the column Sort:
SORT_QUARTER_FORMATTED = CONCATENATE(FORMAT('date table (2)'[Year], "#"), 'date table (2)'[QuarterNo])2. Click on QuarterFormatted column, then "sort by" and choose the calculated column above:In this way, the graph should maintain this order.
Try and let me know.
BBF