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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
krist_pbi
Frequent Visitor

Use a measure to dinamically change dates on other measures

Hey, I believe this is pretty quick, I want to create a measure that can be dinamically filter by another measure that only contains a date.

 

For example, create a calculate similar to this  = CALCULATE ( [total sales], calendar[date] = [date measure])  and being able to filter the sales by referencing the measure that contains the date without putting the date manually in the calculate, 

 

is this possible? I tried but gave me an error

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

To avoid getting an error, you need to use the FILTER function.

Measure 5 = CALCULATE([Fact $],  KEEPFILTERS( FILTER(ALL('Calendar'),'Calendar'[Date] =[measure date])))

Screenshot_3.png

View solution in original post

5 REPLIES 5
v-karpurapud
Community Support
Community Support

Hi @krist_pbi 

We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank You.

v-karpurapud
Community Support
Community Support

Hi @krist_pbi 

Thanks for reaching out to the Microsoft fabric community forum. 

 

I would also take a moment to thank  @Ahmedx  and @Ashish_Mathur , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I hope the shared details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you 

 

 

Best Regards, 
Community Support Team.

Ashish_Mathur
Super User
Super User

Hi,

Does this work?

Measure = CALCULATE([total sales],FILTER{'calendar','Calendar'[Date]=[date measure]))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ahmedx
Super User
Super User

To avoid getting an error, you need to use the FILTER function.

Measure 5 = CALCULATE([Fact $],  KEEPFILTERS( FILTER(ALL('Calendar'),'Calendar'[Date] =[measure date])))

Screenshot_3.png

Ahmedx
Super User
Super User

pls try 

Measure 5 = CALCULATE([Fact $],  KEEPFILTERS( TREATAS({[measure date]},'Calendar'[Date])))

Screenshot_2.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.