Display OrderTotal by Year-MonthName


In the given subject area we have a column OrderDate in DATE-TIME format.
We have been asked to display the OrderTotal measure by Year-Monthname.
How do we do that ?

First step is Create the Year Month Column using the OrderDate column.

[cast (YEAR(Orders."Order date") as char ) ||  ' - '  || cast(MONTHNAME(Orders."Order date") as char )]











Rename the column as Year Month.
Pull the Order Date & Order Total measure.
In the Column formula of Order Total , we just have to write

SUM (Orders."Order total" BY << Select Column YearMonth from the column tab & adjust the parenthesis. )
It will become –

SUM(Orders."Order total" BY (cast (YEAR(Orders."Order date") as char ) ||  ' - '  || cast(MONTHNAME(Orders."Order date") as char )))












See the result –



No comments: