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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
powerbi1980
Advocate I
Advocate I

Measue - Rolling Total Measure Pulling from 2 Tables based on Date

Hi,

 

I would like to have a measure that presents a rolling total of Actual Labour (in the past) AND Future Planned Labour.

 

We have a FactLabour table w/ actual labour and a m:1 relationship with DimDate

We have a FactPlannedLabour table /w planned labour and a m:1 relationship with DimDate

 

I would like to present in a line graph, with the date as the x axis, one line that shows rolling totals of actual labour amounts for days passed, and planned labour amounts for future dates.

 

I have measures to calculate the rolling total sum of actuals and planned based on date. I want these to be combined in essence:

 

Cumulative Planned Labor = CALCULATE (  SUM ( FactPlanLabour[PeriodBill] ),
                                                                     FILTER( ALLSELECTED( FactPlanLabour ),
                                                                     FactPlanLabour[DimDateID] <= MAX( FactPlanLabour[DimDateID] ) ) )
 
Cumulative Labor = CALCULATE ( SUM ( FactLabour[BillAmount] ),
                                                      FILTER( ALLSELECTED( FactLabour ),
                                                      FactLabour[DimDateID] <= MAX( FactLabour[DimDateID] ) ) )
 
Basically, the blue line below, where the grey bar represents today. The dotted portion is the rolling total of the planned labour, and the solid portion is the rolling total of the actual labour
 
powerbi1980_0-1681758514628.png

 

So how can I calulate this? I tried the measure below, but I recognize it won't work as the planned portion will not sum the actual labour.

 

Cumulative Actual or Planned Labour =  IFToday()>ENDOFMONTH(DimDate[Date]),  
                                                                              CALCULATESUM ( FactLabour[BillAmount] ),
                                                                                                    FILTER( ALLSELECTED( FactLabour ),
                                                                                                    FactLabour[DimDateID] <= MAX( FactLabour[DimDateID] ) ) ),                                                                                          CALCULATESUM ( FactPlanLabour[BillAmount] ),
                                                                                                    FILTER( ALLSELECTED( FactPlanLabour ),
                                                                                                    FactPlanLabour[DimDateID] <= MAX( FactPlanLabour[DimDateID] )))                                                                        )
1 REPLY 1
DataInsights
Super User
Super User

@powerbi1980,

 

See if you can adapt the solution in the post below. It uses a blended measure that sums the two underlying measures, using Actual when available and Forecast for the remainder.

 

https://community.fabric.microsoft.com/t5/Desktop/Retrieve-data-in-measure-from-different-tables-bas... 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors