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
AdilFS
Frequent Visitor

Calculate Sales from start date

Need to calculate sales of a shop from start date of a shop.
I have 2 tables : Sales and Date
In Sales table I have information about volume of sales.
In Date table I have shop start date.
I have tried to use that code:

 

SWS comp = 
CALCULATE(Sales[sales], [Start Date] >= [Start Date])​

 

1 ACCEPTED SOLUTION

Try this once,

CALCULATE(SUM([Sales]), ALL(Tablename), [Startdate]>=MIN([Startdate]))

View solution in original post

5 REPLIES 5
devanshi
Helper V
Helper V

Total Sales = 
VAR startdate = FIRSTDATE([Startdate])
CALCULATE(SUM([Sales]) , [Startdate] >= startdate)

There is an issue with syntax

Try this once,

CALCULATE(SUM([Sales]), ALL(Tablename), [Startdate]>=MIN([Startdate]))

Any other way?

If you have ID of shop or sales you can try this:

Total Sales = CALCULATE(SUM([Sales]) ,
                                             FILTER('Tablename', [SalesID] =  SELECTEDVALUE([SalesID]) && 
                                                              [StartDate] = MIN[StartDate]                                                                                                        )
                                )

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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