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! Request now

Reply
torstew
Regular Visitor

How to sum all invoices in the first year after won opportunity

Hello

 

I'm new to PowerBi and DAX. I would like to some all invoices in the year following the close down of an opportunity.

 

Very simply, if the opportunity was closed and won on 31 December 2021, I would like to sum the value of all invoices raised before and including 30 December 2022.

 

Is there a simple formula for this?

 

Thanks a lot. 

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @torstew ,

According to your description, I create a sample.

vkalyjmsft_1-1641981518255.png

If you want to sum the invoices between 2021/12/31 and 2022/12/30, here's my solution, create a measure.

Measure =
CALCULATE (
    SUM ( 'Table'[Invoice] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] > DATE ( 2021, 12, 31 )
            && 'Table'[Date] <= DATE ( 2022, 12, 30 )
    )
)

Get the result.

vkalyjmsft_2-1641981786124.png

More reference of the calculate-functionfilter-functiondate-function.

 

I attach my sample below for reference.

Best Regards,
Community Support Team _ kalyj

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi @torstew 

 

Can you post sample data as text and expected output?
Not enough information to go on;

please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

Thanks for sharing this.

bcdobbs
Community Champion
Community Champion

Sure we can help with that! Can you supply a demo file without sensistive information?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Thanks. I will ask if the requester can provide more details on this topic.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.