Forum Discussion
sort date in slicer
hi all
any idea how i can sort the date , so that the lastest month is on the top? Thanks so much.
Anonymous you didnt do sort by column.
click left mouse on your YYYYMM column in the Fields Pane (right part of powerbi window)
then find and press button Sort by Column and choose YYYYMMdigits
do not hesitate to give a kudo to useful posts and mark solutions as solution
Hi Anonymous
your column [Calendar Month Number] stores month number without leading 0.
to fix it you should either change format this field or rewrite column like this
yyyymmdigit = if('Date'[Calendar Month Number]<10;CONCATENATE('Date'[Calendar Year];concatenate("0";'Date'[Calendar Month Number]));CONCATENATE('Date'[Calendar Year];'Date'[Calendar Month Number]))do not hesitate to give a kudo to useful posts and mark solutions as solution
9 Replies
- az38Community Champion
Hi Anonymous
create new column
YYYYMMdigits = CONCATENATE('Date'[Fiscal Year];'Date'[Fiscal Month Sort Order])then pick your field YYYYMM in the Field Pane. Go to Sort By Column button and select YYYYMMdigits
there is your sample file https://ufile.io/s3ouf2e0
do not hesitate to give a kudo to useful posts and mark solutions as solution
- AnonymousNot applicable
- Tahreem24Super User
Anonymous ,
By clicking on 3 dots on slicer and select Descending. Refer screen shot for your reference.
Don't forget to hit THUMBS UP and mark it as a solution if it helps you!
- v-lionel-msftCommunity Support
Hi Anonymous ,
What is the type of your [YYYYMM] column, Date or Text?If it's Date type, you can refer to Tahreem24 's answer.
If it's Text type, you'd better to convert this column to a date type.
So how does the column come from? is it your original data?
If it comes from a combination of the other two columns, you can refer to az38 's answer.
YYYYMM = CONCATENATE([YYYY]&" ", [MM])Then, convert this column to a date type.
If the column is original data, firstly, you need to split the column, then regroup.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thanks all...I finally got it.
Mine was a text field, after the sorting, now it works!
- AnonymousNot applicable
so sorry, i got the same problem again, it was ok yesterday, where i have gone wrong in this file?
- az38Community Champion
Hi Anonymous
your column [Calendar Month Number] stores month number without leading 0.
to fix it you should either change format this field or rewrite column like this
yyyymmdigit = if('Date'[Calendar Month Number]<10;CONCATENATE('Date'[Calendar Year];concatenate("0";'Date'[Calendar Month Number]));CONCATENATE('Date'[Calendar Year];'Date'[Calendar Month Number]))do not hesitate to give a kudo to useful posts and mark solutions as solution