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
Midway
Helper I
Helper I

Help writing a Measure that calculates MTD AND filter by another field

I have a measure that I need to build that needs to do the following;

 

Calculate the MTD of Sales and then filter it down by another field Sales status = "Active"

I think the CALCAULATE function can be use here like this;

CALCULATE(SUM(Sales[SalesAmount]), DATESMTD(DimDate[Date])) AND then here I need to filter by another field, SaleStatus.

SalesStatus has two values "Active" and "Cancelled", I need to retrieve rows with SalesStatus = "Active".

 

Thanks very much for you help!

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Midway 

Please try

=
CALCULATE (
    SUM ( Sales[SalesAmount] ),
    DATESMTD ( DimDate[Date] ),
    Sales[SaleStatus] = "Active"
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Midway 

Please try

=
CALCULATE (
    SUM ( Sales[SalesAmount] ),
    DATESMTD ( DimDate[Date] ),
    Sales[SaleStatus] = "Active"
)
Midway
Helper I
Helper I

Thank you!

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

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!

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.

Users online (27)