Order by month in power bi

1

I have a excel sheet that gives me something like

Contrato      Jan/2018       Fev/2018       Mar/2018
2010100       15.800,00      9.000,00       15.000,00
2010101       10.000,00     10.000,50       11.000,15

Soon after I did an unpivot of this data resulting in something like this

Contrato      Jan/2018       Fev/2018    Mar/2018     Attribute      Value
2010100       15.800,00      9.000,00    15.000,00    Jan/2018       15.800,00
2010100       15.800,00      9.000,00    15.000,00    Fev/2018        9.000,00
2010100       15.800,00      9.000,00    15.000,00    Mar/2018       15.000,00
2010101       10.000,00     10.000,50    11.000,15    Jan/2018       10.000,00
2010101       10.000,00     10.000,50    11.000,15    Fev/2018       11.000,15
2010101       10.000,00     10.000,50    11.000,15    Mar/2018       10.000,50

Soon after, I create a line chart pulling as data the "Attibute and" Value ", but only that the display order is in alphabetical order and wanted to put in the orders of the months, as Jan / 2018, Feb / 2018 and Mar / 2018

I've tried to go into modeling and sort by column but does not sort by month.

    
asked by anonymous 20.12.2018 / 13:15

1 answer

2

Gabriel in this case you can do the following.

Create a helper table of 'TEMPO' , this table should contain your months / years (the same way they appear in your current table) and another column that can be called 'ORDER' by example.

More or less in this format:

Afterthis,linkthisnewtablewithyouroriginaltable(DATAfield)

Whenyoudothis,youneedtoselectthedatamenuinPowerBI,clickonthe'DATA'columnandthenchangethecolumnclassificationtobesortedbyanothercolumn(ORDER).Aspicturedbelow:

Once this is done, powerbi will begin to sort the date column by 'ORDER' as you have selected it.

Just remembering that this column (DATA) is what has to be placed in your charts / tables, so that it obeys this sort rule.

Important

The order column must be selected with the data type 'INTEGER NUMBER' so that sorting is done properly.

Obs. :

This same process can be done in your current table by creating a custom column and assigning the order for each month / year respectively. For you this you can use some function DAX

    
03.01.2019 / 15:07