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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
TCFPA
Frequent Visitor

Rolling sum not calculating. Seems my date table is broken in some way

I have written the following calculation 

 

 

 

Annualized Revenue by Month = 
                            CALCULATE([Annual Revenue], 
                                       DATESINPERIOD('Calendar Lookup'[Date], 
                                       MAX('Calendar Lookup'[Date]),
                                       -12,
                                       MONTH))

 

 

 

However I am not getting the expected result. The column is entirely blank.

Screenshot 2022-12-05 093555.png

 

My data model is set up as shown

Screenshot 2022-12-05 100721.png

 

Both date data types are the same in both columns

 

 

Now the tricky part is if I mark my Calendar Lookup table as the Date table my calculation works but this will break all my other functions that use the date tableWhat is happening here?

2 ACCEPTED SOLUTIONS

So I figured it out after tweaking it some. I am not sure why but I also have to include the year as part of the rows in the matrix.

 

I thouhgt the filter context would already be evident as the start date has a year is that incorrect?

View solution in original post

v-jianboli-msft
Community Support
Community Support

Hi @TCFPA ,

 

If your date table contains multiple years of data and you do not provide the year in the current context, this is likely to cause inaccurate calculations.

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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-jianboli-msft
Community Support
Community Support

Hi @TCFPA ,

 

If your date table contains multiple years of data and you do not provide the year in the current context, this is likely to cause inaccurate calculations.

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

v-jianboli-msft
Community Support
Community Support

Hi @TCFPA ,

 

The table that DATESINPERIOD() returned can only contain dates stored in the dates column. So, for example, if the dates column starts from July 1, 2017, and the start_date value is July 1, 2016, the returned table will start from July 1, 2017.

Besides, the relationship between LeadSquared and Calendar Lookup is single, please try to change it to both. Otherwise, if you use 'LeadSquared'[Date] as date field, MAX('Calendar Lookup'[Date]) will always return the max value of all date.

 

If these methods could not work, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

So I figured it out after tweaking it some. I am not sure why but I also have to include the year as part of the rows in the matrix.

 

I thouhgt the filter context would already be evident as the start date has a year is that incorrect?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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