Skip to main content

Power BI

Needs Votes

Add date table to Azure enterprise content pack

Vote (2) Share
Hakan.Winther's profile image

Hakan.Winther on 28 Oct 2015 23:39:57

I need a date table in the Azure enterprise content pack to be able to create a line chart by month that is sorted correctly as the month column is sorted as string. (Oct is sorted before September and that makes the line chart missleading)

Comments (1)
Hakan.Winther's profile image Profile Picture

Jorge Segarra Rovira on 05 Jul 2020 22:43:38

RE: Add date table to Azure enterprise content pack

In data view, select the Month (name) column. On modeling tab, select the Sort by option and select to sort by Month (number). The issue with that is that if you have January 2016 and 2017 on same chart, it might sort differently.

What I did was manually created a lookup table with values 1-12 and their associated month and hid the table. I related the two tables together via Month (number). On main table I created a calculated column that brought back the related month name. I created another new calculated column that concatenated the year and month numbers together (in that order). I then selected the month name column and chose to sort by the new yearmonth column. This makes sure if you have two months from different years together on same visual that it won't lump them together.