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
bhmiller89
Helper V
Helper V

Calculate the SUM of Sales$ using a date range

Data Points:

"OktoInvoiceDate," "OKtoInvoiceDate+90", "SaleDate", "Sale$"

 

I need to calculate the SUM(Sale$) that took place during the time frame between "OktoInvoiceDate" and "OktoInvoiceDate+90"

 

These need to be measures

 

I can't figure it out! 

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @bhmiller89,

 

If I understand you correctly, you should be able to follow steps below to get your expected result. Smiley Happy

 

1. Add an individual Calendar table if you don't have one yet.

Date = CALENDARAUTO()

2. Then you can use the formula below to create a measure to calculate the SUM(Sale$) for a selected date that took place during the time frame between "OktoInvoiceDate" and "OktoInvoiceDate+90". 

measure =
VAR currentDate =
    MAX ( 'Date'[Date] )
RETURN
    CALCULATE (
        SUM ( Table1[Sale$] ),
        FILTER (
            Table1,
            Table1[OktoInvoiceDate] <= currentDate
                && Table1[OktoInvoiceDate+90] >= currentDate
        )
    )

 

Regards

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!

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.

Top Solution Authors