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
Kerrymr2
Frequent Visitor

PowerBi Rolling Sum

Hi All,

I have a project where I need to create a rolling Sum.

I have three tables involved,  VScrapRates, VdateDim, and totalscrap.

Rolling Sum 1.JPG

 

My current DAX calculation is as follows:

Rolling12MonthScrap =
CALCULATE(
Sum(TotalScrap[InitalDollars]),
DATESINPERIOD( VDateDim[Date], LASTDATE( VDateDim[Date] ), -12, MONTH ) )
 
The date dim table is a date table and is tied to a timeline slicer.  When the user selects a month on the slicer we want to sum the rolling 12 months of initial dollars from the total scrap table from the selected month backwards.
 
However, this is what I'm getting.  The second row is correct and I have no idea where the first row comes from.  Ideas?
rESULT.JPG
 
Thanks in advance,
K.
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Kerrymr2 , is one of the other your columns un summarized?

Also, make sure yearmonth is coming from VDateDim and it is marked as date table

View solution in original post

3 REPLIES 3
Kerrymr2
Frequent Visitor

VDateDim is marked as a date table.  

If I remove every column except Corporate scrap percentage from VscrapRates in the table it still happens.

If I remove every visual filter, still happens.

If I change the slicer attached to VdateDim, the value remains constant.

It may be that CorporateScrapPercentage is not summarized.  Suggestions on what to try?

Capture2.JPG

 

 

 

 

Thanks, it steered me in the correct direction.  It was an issue where there was no relationship between VscrapRates[plant] and TotalScrap[Plant].

Cleaned up relationships, modified and added some measures and everything is working.

Thanks for steering me in the right direction.

 

K.

amitchandak
Super User
Super User

@Kerrymr2 , is one of the other your columns un summarized?

Also, make sure yearmonth is coming from VDateDim and it is marked as date table

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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