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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
VJ_2692
Frequent Visitor

Approximate Beg Backlog and Approximate ending Backlog DAX not working as required

Hi, I am new to power bi. I have a scenario in which  I have to calculate Approximate Beg Backlog & Approximate Ending Backlog.
The dax formulas for both are as follows:
Approximate Beg Backlog = Approximate Ending Backlog(previous Week), 
Approximate Ending Backlog =Sum of Approximate Beg Backlog, Net Sales (Bookings) through Cancelations.

As you can see, the formulas are interdependent and causing circular dependency with sample dataset as follows:

 

 

3-Oct

10-Oct

17-Oct

  

Approximate Beg Backlog

0

$59,985,386

$548,181,595

54897953

 

A

($2,045,676)

($2,016,818)

($2,200,297)

  

B

($2,435,328)

($2,400,974)

($2,619,401)

  

C

($402,131)

($748,999)

($463,944)

  

Approximate Ending Backlog

$59,985,386

$54,818,595

$542,897,953

  

 

old beg

New Beglog

New Beglog

New Beglog

      

 

Approximate Ending Backlog=
var date1=FIRSTDATE(MarketTable[Start MinWeek])
var addoffour_previouseweek = CALCULATE([addoffour],DATEADD(MarketTable[date],-7,DAY))
var addoffour_prepreviouseweek = CALCULATE([addoffour],DATEADD(MarketTable[date],-14,DAY))
var prepreweek = CALCULATE([addoffour],DATEADD(MarketTable[date],-21,DAY))
var pr1 = CALCULATE([addoffour],DATEADD(MarketTable[date],-28,DAY))

return
IF(date1=MIN(MarketTable[date]),[addoffour],[addoffour]+addoffour_previouseweek+addoffour_prepreviouseweek+prepreweek+pr1)

 

The above formula for Approximate Ending Backlog is giving the result but I have to put variables for each week. I am looking to get this loop functionality dynamically.
How to get it using dax? 

2 REPLIES 2
VJ_2692
Frequent Visitor

I have already created these measures as variables in my dax formula. And it is working for that perticular variables only i.e Four weeks. But I am looking to get this loop functionality dynamically. 

amitchandak
Super User
Super User

@VJ_2692 , You should create a date table and measures like

 

CALCULATE(Sum(Table[Value]) ,DATEADD(Date[date],-7,DAY))

 

CALCULATE(Sum(Table[Value]) ,DATEADD(Date[date],-14,DAY))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.