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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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