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
sebasjun
Helper I
Helper I

PREVIOUSMONTH not work

Hello

 

I have a mistery....

 

I have a simple table and a simple previous month calculate measure

 

Booking Lines PM = CALCULATE(sum(Data[Booking Lines]);PREVIOUSMONTH(Data[Booking Month].[Date]))

 

p1.png

 

Is correct ... But when apply a filter by month (example October) i show this 

 

p2.png

I show a blank value in Previous Month why?

 

Best regards

 

 

1 ACCEPTED SOLUTION

Looked at it and as suspected you have Create Month from Hoja1 table used on rows, please use "Date" column from calendar table on rows and that will do it. see image below.

 

lm.PNG



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.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

You need date dimension for these kind of calculation which seems to be the reason that it is not working. There are many posts on how to create date/calendar dimension in powerbi.



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.

Hello

 

Yes! I can try reading other post. But not running 

 

Step 1: Create a Calendar datatable --> Calendar = CALENDARAUTO()

 

Step 2: Relationship

 

p3.png

 

Step 3: Change Formula

Booking Lines PM = CALCULATE(sum(Data[Booking Lines]);PREVIOUSMONTH('Calendar'[Date]))

 

pr.png

 

Any ideas ... 

In your table what date are you using, use it from your new calendar table.



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.

Hello!

 

Yes I  think is correct....

 

I attach a simple file   File. If you can watch the problem

 

Best Regards

 

 

 

 

Looked at it and as suspected you have Create Month from Hoja1 table used on rows, please use "Date" column from calendar table on rows and that will do it. see image below.

 

lm.PNG



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.

Hello

 

Thanks!  Its so very easy ...

 

Best regards

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.