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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors