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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ommfin123
Frequent Visitor

How to calculate actual sales with using dax language instead of in excel?

Hi all. Wish you a good day!

 

I would like to add a column to calculate the total of actual sales in my Target table. (by month & year as the Target table)

Current formula I am using as below:

Actual Sales = CALCULATE(SUM('Sales Report'[Total]),
FILTER('Sales Report', 'Sales Report'[Estimated Delivery Date]='SalesPlanning'[DATES]))
 
But what I want is date according to the table.
The results I got:
ommfin123_0-1689667033565.png

 

Appreciates lot for your help!

 

5 REPLIES 5
tamerj1
Super User
Super User

Hi @ommfin123 
Please try

Actual Sales =
CALCULATE (
    SUM ( 'Sales Report'[Total] ),
    FILTER (
        ALL ( 'Sales Report' ),
        'Sales Report'[Estimated Delivery Date] = RELATED ( 'SalesPlanning'[DATES] )
    )
)

Dear @tamerj1 . Thank you for your help!

The formula is with no error but the results comes out were the total sales amount of the whole table.

I would like it to filter according to the SalesPlanning's monthyear date, may I know how should I do?

 

Thank you so much.

@ommfin123 

Please try

Actual Sales =
CALCULATE (
SUM ( 'Sales Report'[Total] ),
FILTER (
CALCULATETABLE ( 'Sales Report', ALL ( 'Sales Report' ) ),
'Sales Report'[Estimated Delivery Date] = RELATED ( 'SalesPlanning'[DATES] )
)
)

Hi @tamerj1 . Thank you for your warm help.

Unfortunatelt it still can't get it :'(

ommfin123_0-1689900764014.png

 

Or maybe is my tables' relationship linked wrongly?

I'm not sure too.

ommfin123_1-1689901333618.png

 

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.