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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tobny76
Helper I
Helper I

Need help with how to calculate outstanding amount

Hi all,
I will be very happy if someone can help me with the "Oustadning amount measure".
Don't get it to work and we have release soon.

We should calculate the outstanding amount based on the date selected in the dropdown.

tobny76_1-1744699019696.png


Example data

tobny76_0-1744697766645.png

I will attach the testfiles I have prepaired to getting started quickly.
We have release soon so I will be very happy if somone can help with this. 

Testdata in Excel 
PBIX test file 

 

Thanks in advance!

1 ACCEPTED SOLUTION
sjoerdvn
Super User
Super User

Outstanding Amount Selected Date = 
CALCULATE(
    SUM(SALES_LEDGER_PAYMENTS_M3[Net Amount Local]),
    ALL(SALES_LEDGER_PAYMENTS_M3[Transaction Code]), 
    ALL('Calendar'),
   All(SALES_LEDGER_PAYMENTS_M3[Net Amount Local]),
    All(SALES_LEDGER_PAYMENTS_M3[Payment Date]),
    SALES_LEDGER_PAYMENTS_M3[Accounting Date] <= SELECTEDVALUE(CALENDAR_OVERDUE_SELECTION[Date])
)

View solution in original post

4 REPLIES 4
v-sgandrathi
Community Support
Community Support

Hi @tobny76

 

Has your issue been resolved?If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.

Thank you for your understanding!

sjoerdvn
Super User
Super User

Outstanding Amount Selected Date = 
CALCULATE(
    SUM(SALES_LEDGER_PAYMENTS_M3[Net Amount Local]),
    ALL(SALES_LEDGER_PAYMENTS_M3[Transaction Code]), 
    ALL('Calendar'),
   All(SALES_LEDGER_PAYMENTS_M3[Net Amount Local]),
    All(SALES_LEDGER_PAYMENTS_M3[Payment Date]),
    SALES_LEDGER_PAYMENTS_M3[Accounting Date] <= SELECTEDVALUE(CALENDAR_OVERDUE_SELECTION[Date])
)

If I use your solution it looks like I need to add a new all statemant for every new column I add from the fact table into the visual, or?
Will this not be the same 

Outstanding Amount Selected Date =
CALCULATE(
    SUM(SALES_LEDGER_PAYMENTS_M3[Net Amount Local]),
    ALLEXCEPT(
      SALES_LEDGER_PAYMENTS_M3,
      SALES_LEDGER_PAYMENTS_M3[Invoice Number],
      SALES_LEDGER_PAYMENTS_M3[CompanyKey]
),
    SALES_LEDGER_PAYMENTS_M3[Accounting Date] <= SELECTEDVALUE(CALENDAR_OVERDUE_SELECTION[Date])
)

 

Well, technically your measure will work as well, but I would avoid ALL() and ALLEXCEPT() since it will also disable other slicers or filters you may add in the future.
Also, I added [Net Amount Local] and [Payment Date] to get your example working but I would never add these columns to that visual. Instead I would add measures like "Total Invoiced Amount" and "Last Payment Date".

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.