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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Dave1mo1
Frequent Visitor

How to Calculate "Backlog" on each date in DAX?

Hi, all.

 

I'm trying to calculate my company's historic backlog over the last several years, then plot it on an area chart. I have the following relevant fields:

 

  • Booked Date for the Order
  • Request Date for the Order
  • Invoice Date for the Order
  • Units
  • Sales

I also have a primary relationship set up between Invoice Date & my Date Table, and a secondary relationship set up between Booked Date and my Date Table.

 

My first need is to know, on any given day, the number of units that had been booked but not yet invoiced. That's the most basic definition of backlog. So calculate [Total Units] on that date if the order has been booked on or before that day, but not yet invoiced. I just don't know how to get the syntax right in my DAX.

 

In plain English - Backlog Units equals, for any specific date, the number units associated with orders that have been Booked by that specific date, but not yet Invoiced by that date. How do I do that?

 

Bonus Question: I'd also like to be able to bucket the backlog by the time between "Booked Date" and "Request Date" (when the customer wants the unit delivered), then display those on an area chart as well, so we can those buckets vary over time. How do I create that calculation?

 

Thanks so much!

1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @Dave1mo1 ,

The Table data is shown below:

vzhouwenmsft_0-1716540964545.png

Use the following DAX expression to create a measure

 

 

Measure = 
VAR _a = MAX('Date'[Date])
VAR _b = SUMX(FILTER('Table','Table'[Booked Date for the Order] <= _a && ISBLANK('Table'[Invoice Date for the Order]) || 'Table'[Invoice Date for the Order] > _a ),[Units])
RETURN _b

 

 

Final output

vzhouwenmsft_1-1716541046967.png

 

 

View solution in original post

2 REPLIES 2
Dave1mo1
Frequent Visitor

Hi,

 

So sorry for the delayed response. I'm looking to be able to plot this on an area or line chart over time, which I'm not able to do with the measure above. How would I adjust the measure to be able to calculate what the backlog was on each date and produce something like the chart below?

 

Dave1mo1_0-1717011098424.png

 

v-zhouwen-msft
Community Support
Community Support

Hi @Dave1mo1 ,

The Table data is shown below:

vzhouwenmsft_0-1716540964545.png

Use the following DAX expression to create a measure

 

 

Measure = 
VAR _a = MAX('Date'[Date])
VAR _b = SUMX(FILTER('Table','Table'[Booked Date for the Order] <= _a && ISBLANK('Table'[Invoice Date for the Order]) || 'Table'[Invoice Date for the Order] > _a ),[Units])
RETURN _b

 

 

Final output

vzhouwenmsft_1-1716541046967.png

 

 

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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