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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
tchen0
Regular Visitor

Filters in the Calculation function

Hello, 

I am new here. I have a measure created below:

 

OP_Act = CALCULATE(sum('OP - Data'[Fcst_Act]),  'OP - Data'[Fcst Type]="Actual",   'OP - Data'[OP_date] < date (2018,5,15) )

 

Every month, I have to manually update the filter -e.g.  date (2018,5,15) to date (2018,6,15 ). I have many similar measures. I'd like to create a new measure like

 OP_Act = CALCULATE(sum('OP - Data'[Fcst_Act]),  'OP - Data'[Fcst Type]="Actual",   'OP - Data'[OP_date] < [Control_date]). 

 As long as I update [Control_date] only, the changes can be applied to many measures.   Is there any way I can do? Why I can use now() but not a specifc date I created?

 

Thanks,

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @tchen0,

 

You just need to create a measure for [Control_Date].

Control_Date = DATE(2018,5,15)

By the way, the correct formula should be:

OP_Act =
CALCULATE (
    SUM ( 'OP - Data'[Fcst_Act] ),
    FILTER (
        'OP - Data',
        'OP - Data'[Fcst Type] = "Actual"
            && 'OP - Data'[OP_date] < [Control_Date]
    )
)

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @tchen0,

 

You just need to create a measure for [Control_Date].

Control_Date = DATE(2018,5,15)

By the way, the correct formula should be:

OP_Act =
CALCULATE (
    SUM ( 'OP - Data'[Fcst_Act] ),
    FILTER (
        'OP - Data',
        'OP - Data'[Fcst Type] = "Actual"
            && 'OP - Data'[OP_date] < [Control_Date]
    )
)

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tchen0
Regular Visitor

Hello, 

I am new here. I have a measure created below:

 

OP_Act = CALCULATE(sum('OP - Data'[Fcst_Act]),  'OP - Data'[Fcst Type]="Actual",   'OP - Data'[OP_date] < date (2018,5,15) )

 

Every month, I have to manually update the filter -e.g.  date (2018,5,15) to date (2018,6,15 ). I have many similar measures. I'd like to create a new measure like

 OP_Act = CALCULATE(sum('OP - Data'[Fcst_Act]),  'OP - Data'[Fcst Type]="Actual",   'OP - Data'[OP_date] < [Control_date]). 

 As long as I update [Control_date] only, the changes can be applied to many measures.   Is there any way I can do? Why I can use now() but not a specifc date I created?

 

Thanks,

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.