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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SachinFG
Frequent Visitor

Help with dax measure

Hi team,

 

Need help in figuring out the dax to calculate the sum of values for a given merchant with the start and end date.

 

There are sales ouside the start and end date but need to caluclate only cummulative sales for the below 3 promo dates.

 so for merchant 5032917, the value should be $37000.

 

Merchantstartendvalue
503291710/01/202321/01/202315000
50329171/03/202328/03/202312000
50329175/02/202326/02/202310000

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @SachinFG 
'Date' is a disconnected table

Sales Amount =
SUMX (
    FILTER (
        SaLes,
        Sales[Start] <= MAX ( 'Date'[Date] )
            && Sales[End] >= MAX ( 'Date'[Date] )
    ),
    Sales[Value]
)

If 'Date' is connected then try

Sales Amount =
SUMX (
    FILTER (
        ALL ( SaLes ),
        Sales[Start] <= MAX ( 'Date'[Date] )
            && Sales[End] >= MAX ( 'Date'[Date] )
    ),
    Sales[Value]
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @SachinFG 
'Date' is a disconnected table

Sales Amount =
SUMX (
    FILTER (
        SaLes,
        Sales[Start] <= MAX ( 'Date'[Date] )
            && Sales[End] >= MAX ( 'Date'[Date] )
    ),
    Sales[Value]
)

If 'Date' is connected then try

Sales Amount =
SUMX (
    FILTER (
        ALL ( SaLes ),
        Sales[Start] <= MAX ( 'Date'[Date] )
            && Sales[End] >= MAX ( 'Date'[Date] )
    ),
    Sales[Value]
)

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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