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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Reigning_data
Frequent Visitor

Create a variable to act as a filter within calculate

Hi All,

 

Apologies if this has been answered before, I have tried to google it but I'm not sure how to pose the question.

 

My issue is this:

 

Say I have several measures that need to do the same thing, on different data sources.

 

Example would be

Revenue = CALCULATE ( SUM ( column1 ) ,

DATESBETWEEN ( calendar , DATE ( 2019,01,01 ) , DATE ( 2019,02,01 )

))

 

What I would like to do is to create the DATESBETWEEN filter as it's own variable, seperate from the measure so that, in the eventuality that the DATESBETWEEN period needs changing, I would only need to change it once, not for every measure. Something like below is what I had in mind.

 

Period = DATESBETWEEN ( calendar , DATE ( 2019,01,01 ) , DATE ( 2019,02,01 ) )

Revenue = CALCULATE( SUM ( column1 ) , [Period] )

 

Many thanks,

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Reigning_data 

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hi @Reigning_data 

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.