Forum Discussion
Displaying Month and Year
All,
I have this Date Hierarchy for Year,QTR,Month & Day.
I want to display a line chart with Month and Year.
So it will look like this
NOV 2021 DEC 2021 JAN 2022
However for some reason I can not configure this. Any suggestions?
Hi aishak12 ,
In the fields pane when a visual is selected, remove Quarter and Day and then Expand to the next level in the hierarchy.
If you want a custom period, create a calculated column for that using FORMAT
Month and Year = FORMAT ( Data[Date], "MMM-YY" )The above formula creates calculated column containing text strings so it will be sorted alphabetically with Aug as the first in the row. Create another calculated column to sort the custom period column by
YYYYMM = FORMAT ( Data[Date], "YYYYMM" )Here's a tutorial on how to custom sort a column - https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi
Use the custom period in your visual instead of the actual dates column.
1 Reply
- danextian
Super User
Hi aishak12 ,
In the fields pane when a visual is selected, remove Quarter and Day and then Expand to the next level in the hierarchy.
If you want a custom period, create a calculated column for that using FORMAT
Month and Year = FORMAT ( Data[Date], "MMM-YY" )The above formula creates calculated column containing text strings so it will be sorted alphabetically with Aug as the first in the row. Create another calculated column to sort the custom period column by
YYYYMM = FORMAT ( Data[Date], "YYYYMM" )Here's a tutorial on how to custom sort a column - https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi
Use the custom period in your visual instead of the actual dates column.