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
kamijaja
New Member

previousmonth not working when reordering datekey

Hi Power BI community, 

 

seems like I break previousmonth function or then any previous functions when I try to trick displaying months desc on a dashboard. 

for desc dates on dashboards we found this trick to add a new column desc = tab[date_key] * (-1) and order then datekey according to this new column. the problem is then those previousmonth etc. don't work anymore.

 

do you know then how to trick the dates to be displayed desc and that previous functions would not break?

Thanks!

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @kamijaja,

Based on my test, it could work on my side:

Column = [Date key]*(-1)

1.PNG

Could you please offer me more information about your data structure if possible?

 

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.

I would like to calculate a value based on the previous month. I successfully used the previousmonth function in a measure. The problem with it, is that, whenever I sort date by descending order on a matrix visualization, then the previousmonth measure doesnt work at all.  I used this measure to create the date sort...  "Date_sort = tab[date_key] * (-1)". 

Hi @kamijaja,

Could you please share some sample file to have a test if possible?

 

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.

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.