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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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