Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
MP_123
Employee
Employee

Months Order by

hi,

i have a slicer with months list, sorted on descending order

for example:

Dec

Nov
oct

same if it will be numbers:

12

11

10

the problem, now we are on January, the List is now

Dec Noc Oct Jan

i created a calculated column -if jan then 1 if dec then 2 etc... to sort it correctly

the problem is that i need to change this calculated column every new month

 

is someone have an idea how to sort it?

thanks!

6 REPLIES 6
tringuyenminh92
Memorable Member
Memorable Member

Hi @MP_123,

 

You could create condition column in Query Editor for 12 months, but i dont understand "change this calculated column every new month"?

hi @tringuyenminh92

what i meant is that:

if now we are on January so the calculated Column will be

Jan - 1

Dec - 2

Nov - 3

etc..., Feb will be 12 because it will be the last.

but when we will get to February, its value should be 1, Jan 2 and Dec 3

 

 

@MP_123

 

I think you suppose to have a month number column in your source table. You can add a rank column below:

 

Month Rank = 12 - Month(Today()) + Table[Month Number]

So the current month will be 12, previous month will be 11......

 

 

Then you just need to sort the Month Name based on above Month Rank in descending order.

 

Regards,

@v-sihou-msft

hi, thank you!

I actually don't understand

let's say we are in february

month rank = 12 - 2 +2 =12

but for January = 12 -2 +1 =11

Dec ? = 12 -2 + 12 = 22

 

the Sort isn't good that way. or am i missing something?

thanks!

i want that the rank of DEC will be 10... this month should come after january

Hi @MP_123,

 

I don't know what you are doing with your if statement or first or last or anything, but let me show it as below:

Screenshot 2017-01-18 20.01.22.png

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.