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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Month Sort Working in Table but not in Card

Good afternoon everyone, 
 
Hoping to get a little help here. As the title states, my month sort works perfectly fine in a Table, but is defaulting back to alphabetical in Card view. I am working on a custom KPI scorecard and need to be able to put the most recent month's value in a card. 
 
Month Name = SWITCH(Table_9572[Month], 1, "Jan", 2, "Feb", 3, "Mar", 4, "Apr", 5, "May", 6, "Jun", 7, "Jul", 8, "Aug", 9, "Sep", 10, "Oct", 11, "Nov", 12, "Dec")
 
Month Name is being sorted by the column "Month" and has worked as desired in the other report pages
Month = MONTH(Table_9572[RO Date Invoiced])
 
 
 data preview.PNG
   Table                                            Card
month sort table.PNGmonth sort card.PNG
1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @Anonymous,

From your scenario, the card visual is sorted by unicode for text in power bi:

1.PNG

If you want to show Dec in card, you could refer to below measure:

Last Month name = CALCULATE(MAX('Table1'[Month Name]),FILTER('Table1','Table1'[Month]=MAXX('Table1','Table1'[Month])))

Result:

1.PNG

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @Anonymous,

From your scenario, the card visual is sorted by unicode for text in power bi:

1.PNG

If you want to show Dec in card, you could refer to below measure:

Last Month name = CALCULATE(MAX('Table1'[Month Name]),FILTER('Table1','Table1'[Month]=MAXX('Table1','Table1'[Month])))

Result:

1.PNG

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Worked perfectly. Thank you so much!!!

parry2k
Super User
Super User

@Anonymous I believe at the aggregate function it doesn't use "sort by column". You can achieve the last month name by wiritng specific dax measure

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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